Discuss Scratch
- BookOwl
-
Scratcher
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
-
Scratcher
500+ posts
Terminal Snake
Cool. What kind of window is that? I can help make it run on Windows if you want.
- theonlygusti
-
Scratcher
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
-
Scratcher
500+ posts
Terminal Snake
Well, it's written in Rust, so it must be good- Hacker News
- BookOwl
-
Scratcher
1000+ posts
Terminal Snake
This looks like a really awesome project! I love that you added emojis as well xDThanks!
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.
Well, it's written in Rust, so it must be good

edit:Yes, it was running in a hyper.js terminal. Nice score!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
-
Scratcher
1000+ posts
Terminal Snake
Looks great! It quits whenever I eat an apple though.What OS are you on?
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
-
Scratcher
500+ posts
Terminal Snake
macOS Sierra, and Terminal.app.Looks great! It quits whenever I eat an apple though.What OS are you on?
- BookOwl
-
Scratcher
1000+ posts
Terminal Snake
Weird can you see if it works now?macOS Sierra, and Terminal.app.Looks great! It quits whenever I eat an apple though.What OS are you on?
- Znapi
-
Scratcher
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.Looks great! It quits whenever I eat an apple though.What OS are you on?
Last edited by Znapi (Jan. 11, 2017 02:49:53)
- BookOwl
-
Scratcher
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.Looks great! It quits whenever I eat an apple though.What OS are you on?
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
-
Scratcher
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.Looks great! It quits whenever I eat an apple though.What OS are you on?
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
-
Scratcher
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
-
Scratcher
500+ posts
Terminal Snake
OK, somehow when you installed this before it failed to clean up some temporary directories. The following commands should fix it:That worked, thanks! It works great now.Now try building again.$ cd /Users/znapi/.cargo/registry/src/github.com-1ecc6299db9ec823/termbox-sys-0.2.9/
$ rm -rf .termbox
- BookOwl
-
Scratcher
1000+ posts
Terminal Snake
Glad I could help.OK, somehow when you installed this before it failed to clean up some temporary directories. The following commands should fix it:That worked, thanks! It works great now.Now try building again.$ cd /Users/znapi/.cargo/registry/src/github.com-1ecc6299db9ec823/termbox-sys-0.2.9/
$ rm -rf .termbox










