I've actually built a Snake game with JLine in my CommandBox CLI tool. Here is the code (written in CFML, a JVM language)
You can download CommandBox
here if you want to see the game in action. Run it as `box snake`
Really, all that matters is this line here where I pass an array of AttributedString "lines" which represent the characters I wish to display on the screen. I'm doing so in a timer thread that redraws the screen every so many ms.
The other important bit of code is my waitForKey() method, which listens for the user's keyboard input in another thread and lives here:
Listening for keyboard input isn't quite as easy as you may expect if you're used to listening to key input from JavaScript, etc. You've got to create bindings for all the key chars you want to listen to. You can see in my method, I have a handful of common bindings I set up to make a reusable method.
On a related note, I'm working on an entire curses library for my JLine-powered console tool called Escher which is all built around the basic concept of my snake game. Here's a demo I showed last month at a conference:
Thanks!
~Brad
Developer Advocate
Ortus Solutions, Corp