Earlier quoted context omitted.
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.
Show HN: Logarithmic Flappy 2048
61–70 of 75 posts
Re: Show HN: Logarithmic Flappy 2048
#62Earlier quoted context omitted.
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).
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.
Re: Show HN: Logarithmic Flappy 2048
#63Awaiting Doge and Dr. Who versions.
50% complete: http://doge2048.com/
Re: Show HN: Logarithmic Flappy 2048
#64Re: Show HN: Logarithmic Flappy 2048
#65I 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.
An early version of the code did use log2() on the score internally, but now it does pow(2) externally.
Re: Show HN: Logarithmic Flappy 2048
#66Quite 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 t…
Re: Show HN: Logarithmic Flappy 2048
#67Re: Show HN: Logarithmic Flappy 2048
#68Re: Show HN: Logarithmic Flappy 2048
#69This is actually significantly better than Flappy Bird because it has ACCURATE hit detection.
Re: Show HN: Logarithmic Flappy 2048
#70Welp. http://cl.ly/image/13370z0l053H
Note though you missed the first two statements of 'somaWrapper' and in the return statement of 'optimxWrapper'.