2048 implemented in 487 bytes of C
gist.github.com
2048 implemented in 487 bytes of C
1–10 of 47 posts
Re: 2048 implemented in 487 bytes of C
#2Like the small JS version this also has the bug where you can summon more tiles by pushing again in a direction where movement isn't allowed.
Re: 2048 implemented in 487 bytes of C
#3Huh, was not aware of the "Implicit Int Rule" - http://stackoverflow.com/questions/11064292/declaring-variab....
Re: 2048 implemented in 487 bytes of C
#4 puts(W&1?"WIN":"LOSE");
Shouldn't exit(W&1); be "good enough" while saving some bytes?Re: 2048 implemented in 487 bytes of C
#5beautified one http://pastebin.com/1Vj0jUrR
Re: 2048 implemented in 487 bytes of C
#6While 487 bytes is impressive, it feels like you should round up to the nearest power of two...
Re: 2048 implemented in 487 bytes of C
#7Doesn't run correctly under windows. The code relies on the system call "stty cbreak", which is linux specific.
'stty' is not recognized as an internal or external command, operable program or batch file.
I would love to read comments instead of downvotes. Where am I wrong?
Re: 2048 implemented in 487 bytes of C
#8more readable:
Re: 2048 implemented in 487 bytes of C
#9Doesn't run correctly under windows. The code relies on the system call "stty cbreak", which is linux specific. 'stty' is not recognized as an internal or external command, operable program or batch file. I would love to read comments instead of downvotes. Where am I wrong?
`stty` is not Linux specific, it's common to all Unix-derived systems (including Mac OS X, for example). Windows is not Unix-derived.
Re: 2048 implemented in 487 bytes of C
#10well, bugs or not, 487 bytes is a new high bar... I guess the lisp lads might need to curl up their sleeves.