12 ms·
2048 in the terminal
- DrinkWater 13y agooh yeah, now i don't even have to leave my terminal! Thanks a lot!
- jimhart3000 13y agoThis is awesome and yet another way to kill my productivity! I noticed something that I think is incorrect behavior based on my playing of the original. If I have a row that has 2 - 2 - 4, when I press right, it goes straight to 8, rather than the behavior that I think is supposed to happen - press right once and get 4 - 4, press it again and get 8. A minor difference but does actually change the gameplay a bit.
- hk__2 13y agoHi, author here, thank you for your feedback, but I can’t reproduce the bug. See https://github.com/bfontaine/term2048/commit/5ab27e181431c26c1b04b4c46998c12ad64b485d https://github.com/bfontaine/term2048/commit/5ab27e181431c26... Edit: I’m on this issue, currently trying to write a test to reproduce. Edit 2: fixed!
- ksmiley 13y agoWhat about the other direction? [4,2,2,0] while shifting left or up?
- meylingtaing 13y agoI'm having this issue too, which totally threw me off, as I've finally figured out how to sort of consistently beat the original.
- kostja_gee 13y agoAn android app would be nice, too.
- moron4hire 13y agoRemember when we were 12 years old and this was how we wrote all of our games? Hell, not just games, anything.
- Jtsummers 13y agoNot at 12 for me, I didn't start programming my own games until high school. But this would actually be fun to hack out on my old TI-85 or HP-48G (too bad both got water damaged).
- delinka 13y agoA little buggy: It'll collapse 8,4,4 into 16 in a single move when the original does not. Not always, and I have no idea how to reproduce it. Maybe I should just chalk it up to accidental double-bounce on the keyboard?
- hk__2 13y agoThis has been fixed in v0.1.6, thanks for reporting it!
- codegeek 13y agofinal nail in the coffin :). a highly addictive game in the terminal. Damn you hackers!! Love text based games and bonus for being in the terminal. Btw, I know a few p.eople mentioned that it collapses 2-2-4 kind of combinations in one go and I noticed that too. But, you know what, I personally like this variation.
- mikecarlton 13y agoStay away from Rogue then -- I spent way too much time in grad school on that one!
- michelutti 13y agoplease, stop it :( how can I work this way?
- egeozcan 13y agoThis makes it extremely easy to get lost while playing the game. Think about your estimations and consider yourself warned.
- andyzweb 13y agogoing to make a PR that has support for vi-like navigation, (hjkl)
- DrinkWater 13y agohero of the day!
- koralatov 13y agoThat would be amazing. Thank you.
- BoppreH 13y agoI made a terminal clone too, but to play with bots: https://github.com/boppreh/2048bot https://github.com/boppreh/2048bot I didn't get around to write a good AI, but you can uncomment two lines in the main to play yourself. The interactive play is not colorful or as polished, but works the same way. If you want to write a bot yourself, just call "play_bot(logic)", where "logic" is a function that takes a board state and returns a play. "play_bot" returns the highest piece created.
- mihok 13y agoLove it! Is there a way to change the colors? 4 is Incredibly hard to read in my terminal
- hk__2 13y agoThere’s no way to have custom colors for now, but I can change the default colors. I’m on the collapse bug that was reported by a few people right now, will check back on your issue just after. Edit: I’m on it. Edit 2: I added a `--mode` option in the last version (0.1.7) to change the default colors mode. Use 'dark' on a dark background and 'light' on a light one. For now it only replaces dark blue with white on dark mode and yellow with black on light mode. TL;DR: update with `pip install -U term2048` and use `term2048 --mode dark`.
- mzs 13y agoThanks, it would be sweet if you could use the VI keys or WASD instead of arrows (would work on Windows then)and if you could use A-K instead of the decimal numbers. In that way the aspect ratio could be more square, which I think would improve the ease of noticing chains.
- hk__2 13y agoVI keys are supported in the upcoming 0.2.0 version.
- JosephRedfern 13y agoI've just submitted an implementation of the a-k mode as a pull request: https://github.com/bfontaine/term2048/pull/14 https://github.com/bfontaine/term2048/pull/14
- rabino 13y agoDamn you, you beat me to it. I've been playing with GoLang lately and started to implement 2048 this week as a learning exercise. Nicely done!
- Jtsummers 13y agoPut it on a server, let people telnet to port 2048 (anything else using this yet?) and play the game. Store high scores and display standings. EDIT: Still in the window! 2048 is not used by many projects. So essentially zero risk of a port conflict hosting this on a server with other services running.
- 2810 13y agoomg.. now i can't even work in office
- girvo 13y agoDoomed. I just got a new job, and I'm definitely going to get fired now... ;)
- antr 13y agoI'm genuinely addicted to this. I'd be very happy to pay $5 for a native 2048 iOS game – this will substitute my Flipboard use during my commute.
- carlesfe 13y agoHave you tried Threes? It has a very similar gameplay http://asherv.com/threes/ http://asherv.com/threes/
- RBerenguel 13y agoThere's Threes (https://itunes.apple.com/us/app/threes!/id779157948?mt=8 https://itunes.apple.com/us/app/threes!/id779157948?mt=8) which is similar but not the same (since it requires a 1 and a 2 to generate a 3, which makes it slightly more troublesome. I prefer powers of 2, too, they appeal my inner nerd.
- ColinDabritz 13y agoSome important differences: * the first step is explicitly 1 + 2 = 3 (which you mentioned), 1+1 and 2+2 do NOT add * You move all tiles a single space at once, rather than 'to the edge'. Note tiles only merge when they push together, so an edge or other cards restricting their movement. This is a side effect design decision of single space moving. I do not know if two pairs will merge, e.g. will 3 + 3 + 6 + 6 leave 6 + 12? I suspect it will, but I haven't seen it. * Numbers 1 and 2 both spawn, and there is a 'next number' indicator, although placement still appears random. (A 3 spawned in the tutorial, but I think that was a special case) Overall this leads to a very different feel to the game. Anything else I missed?
- sp332 13y ago3 + 3 + 6 + 6 can't make 6 + 12 because the tiles can only move one step. The ones near the edge will merge first (depending with way you push it).
- antr 13y agoThx. I have just bought it, $3. Its almost the same idea, with slightly different mechanics. The 2048 animations are much "better" imho.
- hk__2 13y agoThank you everyone for the feedback, I fixed the collapse bug that was reported by a few users in v0.1.6, update with `pip install -U term2048`.
- instakill 13y agoHN crack-cocaine.
- guidopallemans 13y agoWe need a javascript implementation! oh wait...
- brilee 13y agoI wrote a similar game called Fibs, where the game mechanism is that adjacent Fibonacci numbers are combined to make the next Fibonacci number. It's also command-line based. https://github.com/brilee/games/blob/master/fibs.py https://github.com/brilee/games/blob/master/fibs.py A short writeup is here: http://moderndescartes.com/essays/fibs http://moderndescartes.com/essays/fibs
- deleted 13y ago[deleted]
- gren 13y agoAwesome, we have a multiplayer version, a bot version, a terminal version, what's next? Who's gonna make the flappy bird version?
- LanceH 13y ago3d
- lifthrasiir 13y agoMinecraft version?
- rbonvall 13y agoPure-CSS-zero-lines-of-javascript version. 2048-as-a-monad version. 2048-as-a-jquery-plugin version.
- hablahaha 13y agoI can't imagine how a pure CSS version would work...
- bane 13y agoYou know, I wonder if we're about to see another tetris phenomenon. One of the miracles of tetris is that the game mechanics scaled from a few dots on an 80s era LCD keychain game to HDTV and surround sound. Some kind of generalized 2048 game, with different or harder goals every "level" and some tweaked mechanics and we could see another one.
- lifthrasiir 13y agoYeah, it is as simple as changing every single mention of 2048 in the source code to 4096. My friend actually tried that and it was... a lot harder than 2048. (The 2048-AI fails to make 4096 for most games, for example.) https://github.com/youknowone/4096 https://github.com/youknowone/4096
- staz 13y agoYou probably need a way to correlate the board size with the goal number
- joering2 13y agowhats wrong with the current size? http://i.imgur.com/IyzOmjn.png http://i.imgur.com/IyzOmjn.png
- hk__2 13y agoregarding term2048, it’s as simple as: from term2048.game import Game Game(goal=4096).loop()
- sdegutis 13y agoI'd like to see a version that has a slightly bigger grid. So apparently there is a market for alterations.
- elwin 13y agoI wrote a clone with a configurable grid size. https://bitbucket.org/ElwinR/ipv4-defrag https://bitbucket.org/ElwinR/ipv4-defrag I decided to give it a network admin theme, but don't be fooled, it's really the same game.
- shawabawa3 13y agoThis game has a 50/50 chance of spawning a 4 or a 2. I believe the original is only 10% chance of spawning a 4, was this intentional?
- hk__2 13y agoI didn’t know about the 10% rule, I should check the original source code and use the same probability.
- shawabawa3 13y agoI submitted a pull request The original source is here: https://github.com/gabrielecirulli/2048/blob/master/js/game_manager.js https://github.com/gabrielecirulli/2048/blob/master/js/game_... (line 62)
- minikomi 13y agoReminds me a lot of https://www.youtube.com/watch?v=GXq_BAb3JEI https://www.youtube.com/watch?v=GXq_BAb3JEI Koro koro puzzle
- ErikRogneby 13y agoI hadn't used pip before. I wonder how many different package managers I have installed now? Figuring out how to install pip on OSX I discovered "easy_install" which I hadn't used before. sudo easy_install pip pip install term2048
- emidln 13y agofrom twitter (@gardaud): “What’s pip?” “A python package manager” “How do I install it?” “easy_install pip” “What’s easy_install?” “A python package manager”
- gcr 13y agoHaha, no kidding. It's not so bad with the right tools. In particular, "virtualenv" lets you make "environments" for python packages so you can install these things without needing root access: - Use your distro package manager to install virtualenv - Make a new virtual environment with: virtualenv /tmp/vv - "Enter" the environment: source /tmp/vv/bin/activate - You now have "pip" so you can say pip install term2048 - Play - rm -r /tmp/vv and log out; everything's all cleaned up now.
- andyhmltn 13y agoSo now I can play this insanely addicting game while looking like I'm working. This is not good!
- sdfjkl 13y agoNow make a web version of the terminal version.
- Sheepshow 13y agoWrite it in C then compile it to JS with emscripten
- patrickg 13y agoI hate you ;-)))
- edwardchiapet 13y agoGreat! At least now I can play in the terminal covertly and no one will even notice!
- joshlegs 13y agoI read this as "What the terminal will look like in the year 2048." I was clearly wrong in my interpretation
- rathboma 13y agoFYI - doesn't seem to install with python 3.3
- hk__2 13y agoThe last version (0.2.1) should support Python 3.2 and 3.3.
- yaur 13y agoAm I the only one watching https://blockchain.info/address/1Ec6onfsQmoP9kkL3zkpB6c5sA4PVcXU2i https://blockchain.info/address/1Ec6onfsQmoP9kkL3zkpB6c5sA4P...? Seems that the original author has made ~200USD off of this so far.
- hackmiester 13y agoThis seems to need a "pip install argparse" but that's not included as a dependency. Pretty cool though!
- tlongren 13y agoWell that's it. Productivity today has been shit and I blame this.
- tnishimura 13y agoMy implementation I did for a programming challenge within my organization: https://github.com/tnishimura/challenge2048 https://github.com/tnishimura/challenge2048
- Pitarou 13y ago$ tail ~/.bash_history open http://news.ycombinator.com pip install term2048 term2048 term2048 term2048 term2048 term2048 term2048 term2048 pip uninstall term2048 Do you see what you've done?