Skip to content
Snippets Groups Projects
Commit 0395780f authored by Alexandre Bury's avatar Alexandre Bury Committed by ticki
Browse files

Add travis integration (#81)

* Add travis integration

* Update examples/rainbow to work on stable
parent 32ff8ba9
No related branches found
No related tags found
No related merge requests found
language: rust
cache: cargo
rust:
- stable
- beta
- nightly
script:
- cargo build --verbose
- cargo test --verbose
- cargo test --release --verbose
#![feature(step_by)]
extern crate termion;
use termion::event::Key;
......@@ -10,8 +8,10 @@ use std::io::{Write, stdout, stdin};
fn rainbow<W: Write>(stdout: &mut W, blue: u8) {
write!(stdout, "{}{}", termion::cursor::Goto(1, 1), termion::clear::All).unwrap();
for red in (0..255).step_by(8 as u8) {
for green in (0..255).step_by(4) {
for red in 0..32 {
let red = red * 8;
for green in 0..64 {
let green = green * 4;
write!(stdout, "{} ", termion::color::Bg(termion::color::Rgb(red, green, blue))).unwrap();
}
write!(stdout, "\n\r").unwrap();
......@@ -24,7 +24,7 @@ fn main() {
let stdin = stdin();
let mut stdout = stdout().into_raw_mode().unwrap();
writeln!(stdout, "{}{}{}Use the arrow keys to change the blue in the rainbow.",
writeln!(stdout, "{}{}{}Use the up/down arrow keys to change the blue in the rainbow.",
termion::clear::All,
termion::cursor::Goto(1, 1),
termion::cursor::Hide).unwrap();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment