74 comments

[ 3.5 ms ] story [ 152 ms ] thread
I suspect you know this, but either way: you should initialize your arrays in R to the proper length-- dynamically growing them within a for-loop as you do with values, func and results in optimxWrapper is extremely slow in R, as it creates a new array every loop, copying the old one.
I feel like I'm failing at R if I'm using a for loop typically.
The for loop is a dirty hack to deal with a bug I didn't want to invest time in for one-off code. I wish I had cropped this out of the screenshot...
Nice. I thought I was the only one using end-of-line semicolons in R! Don't listen to the haters/purists that tell you against them.

Note though you missed the first two statements of 'somaWrapper' and in the return statement of 'optimxWrapper'.

(comment deleted)
Alright, now I understand the appeal of flappy bird.
Inspired by this comment: https://news.ycombinator.com/item?id=7431180

I literally just made the display code use Math.pow(2) on everything, after discovering that changing the internal score by doubling instead of incremental would increase the speed exponentially with each hop, rendering it unplayable.

It is a bit odd when the numbers go into scientific notation. :)

http://i.imgur.com/Q2qHoSs.png

Also, it seems that at a certain point length, the two score boxes will shift to being on top of one another instead of side by side[1], which moves the whole playfield's place in the window. Adds a bit of an added challenge!

[1] http://i.imgur.com/BW6RV2e.png

Cool. I'm on a MBP with 1280x800 resolution and tapping up on the keyboard moves the page to the top, which cuts off the bottom of the game board. A little annoying :(
You can press any key ;)
I would describe this as multiplicative rather than logarithmic. 2×2×2×2...

Or maybe exponential if you consider your score to be 2^(number of walls you've jumped).

I don't get logarithmic, though.

I think the term is "geometric"
Geometric is the same as exponential. It is just a geometric interpretation instead of algebraic.
Pedantically,

    s_n = k (-1)^n
for

    n = 0, 1, 2, ...

and nonzero constant k is a non-constant geometric sequence that doesn't exhibit exponential behavior.
After around 4096 it starts tapering off, hence logarithmic.
(comment deleted)
This is the exponential function, 2^x. Where the independent variable is the number of walls jumped. For instance, after 30 jumps, your score/tile reads 1073741824, or 2^30.
(comment deleted)
Or it's the logarithmic function lg(x), where the independent variable is the score and the dependent variable is roughly proportional to the number of times you've clicked.
Well yes, logbase2(x), where x is your score, does equal the number of wall jumps. But that doesn't account for how the game is laid out. Your score is a result of the number of jumps you've made. The number of jumps you've made is not the result of your score. Therefore, despite these two functions being the inversely related, the correct relationship is 2^x. That is just my opinion though.
I agree "exponential" would have been a more natural choice.

"Therefore, despite these two functions being the inversely related, the correct relationship is 2^x."

There is no "correct relationship", there is a relationship that (depending on choice of variables) we can describe as y=2^x or y=lg(x).

(comment deleted)
Sure, score = 2^walls iff log_2(score) = walls. So, being equivalent statements, one alone can not be correct.

However, as you said, one choice of describing the relationship is certainly more natural. The exponential description assigns a score to every natural number. While the logarithmic description does not.

I would interpret correct in the way that it is sometimes said, "the correct way to think about X is..." which doesn't say other ways of thinking are wrong, but limited or not illuminating.

I chose the name without any thought, really.

An early version of the code did use log2() on the score internally, but now it does pow(2) externally.

Is it just me or do the arrows not lock to the game and push the scrollbar up, making you not see the whole game? The previous game had the same problem.
Awaiting Doge and Dr. Who versions.
50% complete: http://doge2048.com/
I'm too slow to read the pop ups when combining doges. Still looks great otherwise!
That was far more amusing that I thought it would be. I'm not entirely sure why, but just I can't stop laughing at all the doge faces staring at me...
Cool. This version is more challenging since it's hard to remember the ordering of images. Also, I had to cheat to see the "final" image, the derp. That was a motivation, too: I wanted to see what the next image would be!
(comment deleted)
(comment deleted)
(comment deleted)
(comment deleted)
Haha, this is surprisingly easier to get to 2048 than the original 2048.
Quite a coincidence that I see this tonight. I was on the bus today and noticed someone playing a game on their phone, something simple where you have to trace over a pattern as closely as you can. It was frustrating to watch because every time the user wanted to repeat a level or move on to the next, they were forced to tap through a couple of intermediary screens with flashy stats that took up as much time to get through as playing a level. Contrast that to this game where starting over takes me 0.0 seconds. You jump right back into gameplay, forgetting all the frustration that came with messing up on your previous attempt. More games should take note.
Including the original flappy bird. Drove me nuts.
A lot of games use the delay to cause frustration on purpose. Kinda like the old arcade games that didn't have continues.
Ah, but then when will you show users ads, or prompt them to buy 20 gems?
It's a very valid point, but you can't fit everything at once, on the same screen. Current and high score, goals, etc. They add to user experience and satisfaction.
For some users, for some games. In many casual games, a "zero-delay" option would be a nice feature, and a nice bonus for a "remove ads" in-app purchase.
I was thinking the same thing after I failed the first time. Most people might not think of this sort of thing because 'hey, the interstitial shows you important information and it only takes a second', but the ability to just continue immediately after messing up makes the game tremendously more enjoyable.
Only issue is when you press up it scrolls all the way up during the game and it gets cut off.
Only spent 5 seconds playing, but this is brilliant. Well done :)
(comment deleted)
I'm sorry, isn't this just flappy bird?
Got to e+99, now what. Shouldn't it just end at 2048?