Discuss Scratch
- BookOwl
-
1000+ posts
Terminal Snake
I know that this is a better fit for MaC, but I figured that mostly ATers would be interested in this
I've recently created a version of Snake that runs in the terminal. I figured that you guys might like to try it out.
Features:
Screenshots:


Todo:
You can find instructions for installing it on Github
I've recently created a version of Snake that runs in the terminal. I figured that you guys might like to try it out.
Features:
- Runs in the terminal.
- Uses Unicode box drawing characters to create the snake and play area.
- Color!
- If you are running on OS X/macOS, the thing that the snake eats is actually an apple.
Screenshots:


Todo:
- Add highscores
- Make it work on Windows
- Different levels of difficulty
You can find instructions for installing it on Github
Last edited by BookOwl (Jan. 10, 2017 13:26:53)
- birdoftheday
-
500+ posts
Terminal Snake
Cool. What kind of window is that? I can help make it run on Windows if you want.
- theonlygusti
-
1000+ posts
Terminal Snake
This looks like a really awesome project! I love that you added emojis as well xD
Not that that should be “macOS”
- If you are running on OS X/MacOS, the thing that the snake eats is actually an apple.
- birdoftheday
-
500+ posts
Terminal Snake
must be good- Hacker News Well, it's written in Rust, so it
- BookOwl
-
1000+ posts
Terminal Snake
Thanks! This looks like a really awesome project! I love that you added emojis as well xD
Fixed.Not that that should be “macOS”
- If you are running on OS X/MacOS, the thing that the snake eats is actually an apple.
must be goodWell, it's written in Rust, so it

Yes, it was running in a hyper.js terminal. Nice score! edit:Cool. What kind of window is that? I can help make it run on Windows if you want.
hyper.js, maybe?
edit 2: It is good. I got 25, in a really small terminal window:
http://i.cubeupload.com/TwRBUc.png
Last edited by BookOwl (Jan. 10, 2017 13:32:24)
- BookOwl
-
1000+ posts
Terminal Snake
What OS are you on? Looks great! It quits whenever I eat an apple though.
edit
I pushed a commit that should fix this. Can you please try recompiling with the new code and see if it is fixed?
Last edited by BookOwl (Jan. 11, 2017 00:59:21)
- Znapi
-
500+ posts
Terminal Snake
macOS Sierra, and Terminal.app.What OS are you on? Looks great! It quits whenever I eat an apple though.
- BookOwl
-
1000+ posts
Terminal Snake
Weird can you see if it works now?macOS Sierra, and Terminal.app.What OS are you on? Looks great! It quits whenever I eat an apple though.
- Znapi
-
500+ posts
Terminal Snake
I thought it was weird too, because you look like you are on the same system. I tried it again, but it did the same thing. Even weirder, now it is failing to build “termbox-sys”. Idk what I did but termbox doesn't like my machine. I'm guessing the issue is on my end now.Weird can you see if it works now?macOS Sierra, and Terminal.app.What OS are you on? Looks great! It quits whenever I eat an apple though.
Last edited by Znapi (Jan. 11, 2017 02:49:53)
- BookOwl
-
1000+ posts
Terminal Snake
It shouldn't even have to build termbox-sys again. Can you post a screenshot of what happens when you try to build it?I thought it was weird too, because you look like you are on the same system. I tried it again, but it did the same thing. Even weirder, now it is failing to build “termbox-sys”. Idk what I did but termbox doesn't like my machine. I'm guessing the issue is on my end now.Weird can you see if it works now?macOS Sierra, and Terminal.app.What OS are you on? Looks great! It quits whenever I eat an apple though.
If you just want to play it, you can get a built version of it here.
Edit:
I've pushed a new version to github that should fix all the crashing issues. Please try building again.
Last edited by BookOwl (Jan. 11, 2017 14:37:51)
- Znapi
-
500+ posts
Terminal Snake
It had to build it again because I decided to clone the repo that way I didn't just keep downloading ZIPs. Here's what it says when trying to build:It shouldn't even have to build termbox-sys again. Can you post a screenshot of what happens when you try to build it?I thought it was weird too, because you look like you are on the same system. I tried it again, but it did the same thing. Even weirder, now it is failing to build “termbox-sys”. Idk what I did but termbox doesn't like my machine. I'm guessing the issue is on my end now.Weird can you see if it works now?macOS Sierra, and Terminal.app.What OS are you on? Looks great! It quits whenever I eat an apple though.
If you just want to play it, you can get a built version of it here.
Edit:
I've pushed a new version to github that should fix all the crashing issues. Please try building again.
snake-rs znapi$ cargo build --release
Compiling fps_clock v1.0.0
Compiling num-integer v0.1.32
Compiling num-complex v0.1.35
Compiling rustc_version v0.1.7
Compiling termbox-sys v0.2.9
Build failed, waiting for other jobs to finish...
error: failed to run custom build command for `termbox-sys v0.2.9`
process didn't exit successfully: `/Users/znapi/Programming/snake-rs/target/release/build/termbox-sys-9fd4f9b8a499569c/build-script-build` (exit code: 101)
--- stdout
running: "git" "clone" "https://github.com/nsf/termbox" ".termbox"
--- stderr
fatal: destination path '.termbox' already exists and is not an empty directory.
thread 'main' panicked at 'assertion failed: cmd.stdout(Stdio::inherit()).stderr(Stdio::inherit()).status().unwrap().success()', /Users/znapi/.cargo/registry/src/github.com-1ecc6299db9ec823/termbox-sys-0.2.9/build.rs:86
note: Run with `RUST_BACKTRACE=1` for a backtrace.
- BookOwl
-
1000+ posts
Terminal Snake
OK, somehow when you installed this before it failed to clean up some temporary directories. The following commands should fix it:
Now try building again.
$ cd /Users/znapi/.cargo/registry/src/github.com-1ecc6299db9ec823/termbox-sys-0.2.9/
$ rm -rf .termbox
- Znapi
-
500+ posts
Terminal Snake
That worked, thanks! It works great now. OK, somehow when you installed this before it failed to clean up some temporary directories. The following commands should fix it:Now try building again.$ cd /Users/znapi/.cargo/registry/src/github.com-1ecc6299db9ec823/termbox-sys-0.2.9/
$ rm -rf .termbox
- BookOwl
-
1000+ posts
Terminal Snake
Glad I could help.That worked, thanks! It works great now. OK, somehow when you installed this before it failed to clean up some temporary directories. The following commands should fix it:Now try building again.$ cd /Users/znapi/.cargo/registry/src/github.com-1ecc6299db9ec823/termbox-sys-0.2.9/
$ rm -rf .termbox
