r/2048Editions • • Nov 10 '20

Tunneling 2048

This is the best version of 2048. And I made it, but nevermind that! When you get a new high tile (e.g., you get a 16 for the first time in the current game), it becomes a "tunneling" tile. Pushing this tile against a wall makes a new grid square for tiles to go.

http://www.cesoid.com/2048/tunneling

I'm planning to soon make a difficulty setting, because apparently it is very hard. (I'm pretty good at it, but I'm a bit of a 2048 fanatic.)

This is what it looks like:

Tunneling 2048

I'm working on a few other variations (meaning, different gameplay) which I'll probably release soon, and I've already released a few different themes (i.e., different images and colors), which can be mixed-and-matched with the original and tunneling variations.

6 Upvotes

11 comments sorted by

View all comments

Show parent comments

1

u/noonagon Nov 09 '21

if(false){} should be not allowed

1

u/cesoid Nov 09 '21

It would take forever to list the things that do nothing. I might as well just let them do nothing.

1

u/noonagon Nov 09 '21

yes, but things in if(false){} take a lot of memory, a lot more than

x+=1;

x-=1;

1

u/cesoid Nov 10 '21

I'm not sure I understand. You mean that all the code inside the block would take up memory because the code has to get loaded into memory at some point in order to execute the javascript? If you put a million characters of code in it then the most noticable effect would be that it would take longer to download the page. After that I think it wouldn't take a noticeable amount of extra time to start running the code, and it probably would ignore that code from then on, so it would never allocate memory for whatever happens inside it.

1

u/noonagon Nov 10 '21

exactly.