Snake written in ncurses & Haskell
Turn README into markdown
I'm probably a bit dyslexic
Change Simple graphics & tweak Readme


browse  log 



You can also use your local clone with git send-email.

#Snake written in Haskell

#Cool features

  • Command line arguments: alter the dimensions, the seed & ASCII style
  • Pausing / resuming ('p')
  • Replaying your last game ('r')
  • High scores (for given window sizes)
  • Seeding
  • Speed up with Spacebar
  • Speeding up when you eat fruit

#How to run

  • Make sure you've got stack installed. Then:
git clone https://github.com/will-clarke/snake-haskell
cd snake-haskell
stack run

#Dev TODOs:

  • [ ] backwards mode: keys do the opposite of what you expect (/ something totally random)
  • [ ] make snake head a different colour
  • [ ] high scores stored on a server somewhere?????
  • [ ] changing background colours depending on the level ----- DO WE EVEN WANT THIS?
  • [ ] Find out how to get screen dimensions from Brick. This could be tricky / monad-y
  • [ ] parsing -- some DSL for styling / add a map
  • [x] only change dimensions with command line arguments
  • [x] Make the game faster as you eat more fruit
  • [x] show high scores
  • [x] update high scores
  • [x] Make sure all record-syntax functions are sytematically named (eg. "getSomething")
  • [x] high scores stored locally?
  • [x] start snake in the middle
  • [x] Start snake moving left to right or something
  • [x] implement pausing / resuming on screen blur / focus
  • [x] make it so you can't move further from the boundary
  • [x] add an endgame screen
  • [x] add a pre-game screen
  • [x] Make head of snake a different colour
  • [x] (related to below): allow command line args to toggle between simple / complex graphics
  • [x] Add attributes to make it pretty
  • [x] Colour in the snake
  • [x] Colour in the Food
  • [x] Actually make pretty attributes pretty
  • [x] move stdgen into food
  • [x] rename model
  • [x] remove keypress
  • [x] Don't allow snakes to turn on 180 degrees
  • [x] Reseed food after it's eaten
  • [x] Allow Food to be eatable
  • [x] Make food increment the score
  • [x] command line -- pass in initial seed. Optparse-applicative. Maybe different game modes (eg. just left-right)

Next projects ideas:

  • Parse "One hundred and twenty eight" into 128
  • Parse cron
  • Invent regular expression language
  • Invent L-System turtle thing