Snake: Difference between revisions

Content deleted Content added
Vvshard (talk | contribs)
Vvshard (talk | contribs)
Line 2,788: Line 2,788:


Along the way, the possibility of restarting while maintaining the length of the snake has been implemented. Now a long snake is available to everyone!
Along the way, the possibility of restarting while maintaining the length of the snake has been implemented. Now a long snake is available to everyone!

[http://github.com/vvshard/rust-rosetta/blob/additive-primes%2Bfib/tasks/snake/SnkRust.png snake game screenshot (rust, Windows 7)]
<lang fsharp>/* add to file Cargo.toml:
<lang fsharp>/* add to file Cargo.toml:
[dependencies]
[dependencies]
Line 2,843: Line 2,845:
}
}


pub fn main() {
fn main() {
let [bg, tail, turn, body, food, head] = [0usize, 1, 2, 3, 4, 5];
let [bg, tail, turn, body, food, head] = [0usize, 1, 2, 3, 4, 5];
let mut colors = [(0x00, 0xF0, 0xA0); 6]; // color tail, turn, body
let mut colors = [(0x00, 0xF0, 0xA0); 6]; // color tail, turn, body