PDA

View Full Version : codes



IfYouSaySo
11-17-2005, 12:35 PM
the codes written in MFC are almost unreadable.
it is really hard for me to find out what's going on by reading these codes.


I see this quite a bit. "Source code" refered to in the plural with "codes". To me it sounds juvenille, uneducated, and somewhat annoying. Is it just me?

Govtcheez
11-17-2005, 12:37 PM
up up down down left right left right b a b a select start

CornedBee
11-17-2005, 12:40 PM
I think I heard that one once.


left up right down xy

down x x x x


On topic: no, it's not just you. Code as in program code is neither singular nor plural, though I forgot what you call those words.

no-one
11-17-2005, 12:41 PM
up down left right b a b y l a r a

Shadow
11-17-2005, 12:55 PM
up up down down left right left right b a b a select start
So that's how I get into your safe.

Quantum1024
11-17-2005, 01:00 PM
Not everyone on the internet is a native english speaker which could explain such things.

-=SoKrA=-
11-17-2005, 01:17 PM
@CornedBee: They're called uncountable nouns, like water, milk, money.

@Quantum1024: It's not just English. Every language I know (Spanish, English, German and French) has this. I think Arabic has it as well, but I'm not sure. I don't know much about asiatic languages apart that they don't have articles (Chinese and Japanese at least, Vietnamese probably neither. Russian doesn't have them, but that's not really asiatic) so I can't comment on those.
Sure, some of the people that say that may not have that distiction in their own language, but I think most of them is just that they don't stop to think.

And it also annoys me when I read stuff like that.

CornedBee
11-17-2005, 01:20 PM
Sokra, the problem is not that the distinction doesn't exist, but that people think they have to learn the words where it applies. They don't apply common sense.

major_small
11-17-2005, 01:21 PM
hold A, press up, down, left, right, release A. hear a sound. hold B, press start. another sound. hold C, press start. Invincible.

yeah, i see that alot around here, and it really bugs me, but I never correct anybody that does it...

-=SoKrA=-
11-17-2005, 01:34 PM
CornedBee, yeah, that's another factor. People who either try to base a language completely on rules, which doesn't always work, or people who just don't give a ........ and do whatever they feel like, which never works.

Of course, let's remember this is the Internet. As a general rule poeple leave their common sense somewhere else when they're using a computer, and doubly so if they use the Internet.

kryptkat
11-17-2005, 02:44 PM
up up down down left right left right b a b a select start


mouserbaiting?

nickname_changed
11-17-2005, 05:05 PM
up up down down left right left right b a b a select start

Isn't that the cheat to get the monster in Killer Instinct (you have to be the flaming guy or the ninja guy, I can't remember which)?

Shadow
11-17-2005, 05:08 PM
Isn't that the cheat to get the monster in Killer Instinct (you have to be the flaming guy or the ninja guy, I can't remember which)?
Nope:
http://www.gamefaqs.com/coinop/arcade/code/583590.html

This is:
http://www.gamefaqs.com/console/nes/code/563399.html

IfYouSaySo
11-17-2005, 05:58 PM
I was wondering about the up-down-right-right-start stuff. I don't play games, but I figured it was a reference to something like that. For what it's worth, I think the "codes" people are the same ones who say "wat" instead of what, and "enuf" instead of enough.

Govtcheez
11-17-2005, 06:11 PM
This is:
http://www.gamefaqs.com/console/nes/code/563399.htmlThere's only one B A? That's a little disappointing. I've been remembering it wrong this whole time.

Paul, I'm ashamed in you.

Shadow
11-17-2005, 06:26 PM
There's only one B A? That's a little disappointing. I've been remembering it wrong this whole time.

Paul, I'm ashamed in you.
I always remembered that code coming from Contra on the NES. There might have been a similar one for Super Contra/Contra 2 but I can't remember.

I also don't know what the trendy vintage shirt sold at hot topic and other places had for that code(there was a shirt with that code printed on the front).

I remember few codes from games. I remember how to do the infinite guy trick in Mario Brothers 1 on stage 3-1 but you can only do it on the exact and original NES catridge-based data(weather the new versions are NES emulations are not might prove this). The Mario 1 featured in Mario All Stars was so not even close. The bug doesn't work.

Hacks are a lot more fun for me. I like the Rainbow Set hacks for Street Fighter 2's original arcade engine(The World Warrior, Champion Edition and Hyper Fighting). That was crazy stuff. Air moves for everyone. 12 fireballs on the screen at once and morphing into anyone you want VIA cycling through the cast with the start button.

Govtcheez
11-17-2005, 06:27 PM
> I also don't know what the trendy vintage shirt sold at hot topic and other places had for that code(there was a shirt with that code printed on the front).

Yeah, I've seen that too.

To be fair, I never actually owned a Nintendo.

Shadow
11-17-2005, 06:29 PM
> I also don't know what the trendy vintage shirt sold at hot topic and other places had for that code(there was a shirt with that code printed on the front).

Yeah, I've seen that too.

To be fair, I never actually owned a Nintendo.
I have 2. The original front loader and rare top loader. :D

PJYelton
11-17-2005, 08:30 PM
Favorite code: DOWN, RIGHT, LEFT, DOWN, DOWN, RIGHT, "When it is." This was to create a super team in Baseball Stars for Nintendo.

For the original question, aren't you guys being a little harsh? I can count the numerous grammar mistakes all of you have made while complaining about this one mistake. Also, for the many of non-english speakers and young native speakers this is an extremely easy error to make considering A) Most synonyms for code in this case WOULD be pluralized (ie programS) but also B) the word "code" is pluralized in many other instances (ie cheat codeS).

IfYouSaySo
11-17-2005, 08:40 PM
aren't you guys being a little harsh


We are if it's an honest mistake. But personally I think they do it on purpose. If u no wat I mean.

PJYelton
11-17-2005, 08:48 PM
Considering most bad writing on the internet comes from trying to type the least amount of letters and remain legible, I doubt they'll go out of their way to type that extra letter just to annoy you ;)

Shadow
11-17-2005, 09:04 PM
I like the errors found here: http://engrish.com

IfYouSaySo
11-17-2005, 11:05 PM
Ok, I have a question for PJYelton.

About somes codes that I wrote.

No joke. I am currently wasting time writing a connect four game, and I have run into a problem, and I figure you're the guy to ask since you won the C4 tournament some time back.
The game is pretty far along. It plays pretty well. I have an MFC GUI for it. Right now it only plays the black pieces (moves second). I implemented using minimax & alpha-beta pruning. My board representation uses bitboards.

Here is the problem: It plays best when I set the depth to 1. The larger I set the search depth to, the worse it plays. I'm not sure how to account for this. I'm fairly certain that the minimax/alphabeta algorithm is correct.

Any ideas?

PJYelton
11-17-2005, 11:32 PM
I wouldn't think it would play well at all at only a depth of 1. Typically all it can do by looking one move ahead is make an immediate win or block an immediate loss. If you think the evaluation function works fine my best guess would be you aren't undoing the moves properly when you move up a recursive level. Tough to say though without seeing code.

IfYouSaySo
11-17-2005, 11:51 PM
Well...

I'm working on it at the minute. Not sure about the evaluation function entirely but so far I've found two bugs. They are related to implicit type conversions. You see, the bitboards are 64 bit ints (__int64 type), and so I get these types of problems:



bool game_state::min_occupies(int column, int row) const
{
# if OLD_BROKEN_CODE
int n = (row * 8) + column;
return (min_ & (1<<n)) != 0;
# else
int n = (row * 8) + column;
bitboard_t shl = 1;
shl <<= n;
bitboard_t res = min_ & shl;
return res != 0;
# endif
}


So what happens in the broken code is that (1<<n) gets converted to a 32 bit integer type (native size for my processor), and an overflow occurs, so min_ & 0 == 0, etc. This wasn't the only case of this stuff. It's all over the place, and not exactly easy to spot.

Anyway, there are probably other problems as well... :(

IfYouSaySo
11-17-2005, 11:53 PM
But I would like to challenge your engine when I am finished. If that is somehow possible.

Decrypt
11-18-2005, 09:04 AM
I swear that NES code is up-up-down-down-left-right-left-right-B-A-B-A-start (or select start for two players.)
I don't have Contra anymore, but I think a friend does; I'll have him check it. IIRC, it works for pretty much every Konami game for the NES.

IfYouSaySo
11-18-2005, 09:34 AM
I have gained a new appriciation of assert(). I think I've found all the bugs; I can't beat my program anymore. Actually it kicks my butt every single time. I have the search depth at 7. And I haven't even added a heuristic for ordering the candidate moves, which is supposed to make alpha-beta perform much faster. I'm afraid to see what will happen if I can speed it up and set the search depth even larger. Stay tuned for progress on my codes.

Govtcheez
11-18-2005, 09:54 AM
I swear that NES code is up-up-down-down-left-right-left-right-B-A-B-A-start (or select start for two players.)
I don't have Contra anymore, but I think a friend does; I'll have him check it. IIRC, it works for pretty much every Konami game for the NES.
THANK YOU

And likewise, I'm 99% positive it's either 99 or 90 guys, not 30.

major_small
11-18-2005, 10:38 AM
well, from searching, I find Shadow's results ALOT more, but I did find govt's results, always alongside Shadow's... my conclusion: You're both right, but govt's is the lesser-known (or doesn't work in all versions of the game:

http://www.gamewinners.com/nes/Contra.htm

PJYelton
11-18-2005, 10:40 AM
You should be able to download my code from the c4 contest results thread, I doubt it would be difficult to incorporate into your program to see which one would win. Just make sure your program doesn't take more than a second to make a move to be fair since that was part of the contest rules ;)

Shadow
11-18-2005, 11:16 AM
well, from searching, I find Shadow's results ALOT more, but I did find govt's results, always alongside Shadow's... my conclusion: You're both right, but govt's is the lesser-known (or doesn't work in all versions of the game:

http://www.gamewinners.com/nes/Contra.htm

I always thought that code originated from Contra 1 on the NES. I do want to say Govtcheez is right as well but GameFAQs is a pretty widely used code and information source for video games. Everything else they have is essentially verified. I also have nooooo clue if that code was in other games or a variation of it was, that'd be a new one on me(simply because I never paid attention).

But hey, in about 5 minutes you could be playing that game on your computer with an emulation search.

Discussing a video game code from the 80s. There's a thread derailment. :D

IfYouSaySo
11-18-2005, 11:42 AM
I think right now my game takes more like 2-3 seconds for the first ~5-7 moves. So I'll have to find some way to improve performance. Or I could have it start at a smaller depth, and incrementally increase the depth as the game continues. Or I could implement a transposition table and iterative deepening with a timeout indicator to stop at 1 second of search. Depends on how ambitious I feel this weekend.

BTW, I have a fairly advanced evaluation function, which is why it plays not too bad even for depth 1. Basically Eval does the following (pseudocode):



int eval()
{
for each 4-in-a-row possible on the board
do
if both min and max have played a piece in that board
then
assign no points and continue
else if max played piece in that board
if max has 4 of 4 then eval = MAX_WINS
if max has 3 of 4 then eval += MAX_BIG_ADVANTAGE
else if max has 2 of 4 then eval += MAX_SMALL_ADVANTAGE
else if min played piece in that board
if min has 4 of 4 then eval = MIN_WINS
if min has 3 of 4 then eval += MIN_BIG_ADVANTAGE
else if min has 2 of 4 then eval += MIN_SMALL_ADVANTAGE
end if
done
}


And in the code above the MAX_* constants are positive, and the MIN_* constants are negative. So what ends up happening, is that max favors moves that maximize 2 and 3 in a rows, but also might favor moves that kill min's 2 or 3 in a rows. So even at depth 1, the computer for instance "see" which play will minimize the opponents chances (by killing the most winning boards)--even it it isn't computationally certain that it's choice is correct.

PJYelton
11-18-2005, 01:10 PM
Not bad, let me know how our two programs fare against each other.

Decrypt
11-18-2005, 03:09 PM
My whole life has been a lie.
http://en.wikipedia.org/wiki/Konami_Code

It must be that both work; a co-worker confirmed he used the B-A-B-A version, too.


Discussing a video game code from the 80s. There's a thread derailment.
No doubt. We've gone from bad grammar to random game cheat codes to the specifics of one code to Connect Four AI and back again. Wow.