Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mossr/snake.jl
The game of snake in the Julia REPL
https://github.com/mossr/snake.jl
Last synced: about 1 month ago
JSON representation
The game of snake in the Julia REPL
- Host: GitHub
- URL: https://github.com/mossr/snake.jl
- Owner: mossr
- License: mit
- Created: 2020-10-09T01:47:28.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-10-13T07:45:39.000Z (about 1 year ago)
- Last Synced: 2024-09-09T06:01:10.078Z (2 months ago)
- Language: Julia
- Size: 198 KB
- Stars: 6
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Snake.jl
The game of snake in the Julia REPL. 🟩🟩🟩🟩🟩 🍎
> Modified from [Chris DeLeon's 4:30 minute Javascript version](https://youtu.be/xGmXxpIj6vs).
## Installation
```julia
] add Snake
```## Gameplay
```julia
using Snake
```
The game will start automatically.
- Hit `backtick` to pause the game.
- Resume with `play()` or restart the game with `restart()`## Controls (wasd)
* `a` and `d` to apply left and right velocity
* `s` to apply down velocity
* `w` to apply up velocity
* `backtick` to pause, then `play()` to resume## Emoji support
To play using emojis, run:```julia
play(emoji=true)
```
## Other options
- `play(walls=true)`: Restart the game when hitting walls (default `false`)
- `play(size=(20,20))`: Change game field dimensions (default `(20,20)`)---
[Robert Moss](http://web.stanford.edu/~mossr)