6 ms·
Show HN: 2048.cpp – Play 2048 in directly your terminal
- jgtrosh 8y agoI did a similar thing with 1010 a while ago: https://github.com/trosh/1010 https://github.com/trosh/1010 These projects are probably useless but very fun to make and contribute to if you feel like practising. Some stranger actually contributed to my rushed 1010 clone, it was the best feeling ever.
- billconan 8y agonice! how did you record the commandline as a gif?
- ioddly 8y agoNot sure how OP did it, but I use peek. Pretty handy for readmes, even for showing clients stuff without having to deploy.
- deleted 8y ago[deleted]
- alexkavon 8y agoIf you’re on OS X, gifox is nice.[0] [0] https://gifox.io https://gifox.io
- asgeir 8y agoPersonally, I'm fond of https://asciinema.org/ https://asciinema.org/
- gbaygon 8y agoI will throw another option, very lightweight: licecap, works on win and osx, from the original dev of winamp! https://www.cockos.com/licecap/ https://www.cockos.com/licecap/
- mikewhy 8y agoHad no idea and I've been pushing licecap for years.
- ninjakeyboard 8y agoVery cool! I noticed Wikipedia references another app for terminal in C: https://github.com/Tiehuis/2048-cli https://github.com/Tiehuis/2048-cli Might be interesting to compare.
- krylon 8y agoThere is version written in sed, too.
- themattrix 8y agoThat was mine! https://github.com/themattrix/sed2048 https://github.com/themattrix/sed2048
- krylon 8y agoYou rock! EDIT: Not only because of the technical achievement, but because this little has allowed me to waste some time playing a fun game, while looking very busy to passers-by to whom anything being done in a terminal looks like black magic from The Matrix. ;-) That game can be seriously addictive.
- erayare 8y agoType telnet telehack.com 2048 in a terminal
- garaetjjte 8y agoFor other telnet games, there is milek7.pl with tetris, breakout and multiplayer pong.
- ccozan 8y agooh, I miss the backgammon games over telnet. Does anyone knows of any servers still online?
- patrickdavey 8y agoThere's always fibs :) telnet fibs.com 4321
- Fnoord 8y agoTetrinet for CLI [1]. Not sure if it still works. Also, Tron over SSH [2] [1] http://tetrinet.or.cz/ http://tetrinet.or.cz/ [2] $ ssh sshtron.zachlatta.com
- josteink 8y agoHave we really come so far? This has to be full circle, right? First we had a wave of “see what can be done in a browser!” kind of demos. Which at the time was massively impressing, because nobody thought you could seriously use the browser for other things than documents and very slow and clicky applications. These days impressive browser-based experiences are the norm and native software is often accused of being visually “boring” and inanimate. And here we’re back at the beginning: a tech demo for a native app, in the terminal, trying to reproduce what was once a tech demo of what you could do in a browser, as if that’s somehow novel. Just 30 (or more?) years after nethack. I’m honestly not sure how to feel about that ;)
- chx 8y ago> trying to reproduce what was once a tech demo of what you could do in a browser 2048 was never that, it was a shitty knockoff of Threes and remains so.
- TeMPOraL 8y agoMaybe it's a knockoff, but I'd call it improved. I never liked number 3, and for me the additions in Threes look completely arbitrary. Whereas 2048 features nice, round (base 2) numbers. And I'm only half-joking. I've been working with base 2 for two thirds of my life now, so powers of two are really more pleasant emotionally to me than multiples of 3.
- abecedarius 8y agoAnother, in Python: https://github.com/darius/sturm/blob/master/2048.py https://github.com/darius/sturm/blob/master/2048.py This one animates the sliding of the pieces. The terminal input-handling might not work in your OS -- I gave up trying to find a nice cross-platform approach to that.
- hk__2 8y ago> The terminal input-handling might not work in your OS -- I gave up trying to find a nice cross-platform approach to that. I wrote a terminal version of 2048 back in 2014 [1] and the input-handling works on all platforms I know of. You may want to look at the code: https://github.com/bfontaine/term2048/blob/master/term2048/keypress.py https://github.com/bfontaine/term2048/blob/master/term2048/k... [1]: https://github.com/bfontaine/term2048 https://github.com/bfontaine/term2048
- abecedarius 8y agoThanks. I'm not sure yet if that will help with the trouble I was having (I wanted the library to support extra features not needed for 2048), but it's great to see small code to learn from.
- Mic92 8y agoShameless self-plug: Play 2048 in the kernel - https://github.com/Mic92/2048.ko https://github.com/Mic92/2048.ko
- djsumdog 8y agoHuh. Seems to misalign the right side of the grid in my terminal. Still pretty cool though.
- necubi 8y agoA few years ago I wrote a terminal version of threes (the imho better predecessor to 2048): https://github.com/mwylde/Threes.scala https://github.com/mwylde/Threes.scala, including ANSI graphics for the gameboard.
- foota 8y agoAt first I thought this was going to be one of those template preprocessor games.
- sossles 8y agoOk, now I'm tempted to rewrite Twenty to work in the terminal. It's already c++!
- tlextrait 8y agoWrote it in C++ too a while back (5 years ago ) https://github.com/tlextrait/2048 https://github.com/tlextrait/2048
- iraphael 8y agoI wrote it in c as a first project in intro CS in college: https://github.com/iRapha/2048linux https://github.com/iRapha/2048linux
- vmednis 8y agoDid a similar thing a while ago that should work on all POSIX systems. https://github.com/vmednis/2048 https://github.com/vmednis/2048
- evex 8y agoSame in Rust https://github.com/0xbsec/terminal2048 https://github.com/0xbsec/terminal2048