I don't understand what the problem is even though I looked through the code several times, but because I am new I might be missing something very important.Rust is a bit quirky.
fn main() {
const HEIGHT:i32= 256;
const WIDHT:i32 = 256;
println!("P3\n{} {}\n255",WIDHT,HEIGHT);
let mut i_count=HEIGHT-1;
let mut n_count=0;
while i_count >= 0
{
while n_count <=WIDHT-1
{
let r = n_count as f64 / (WIDHT-1)as f64;
let g = i_count as f64 / (HEIGHT-1)as f64;
let b =0.25;
let ir = (255.999*r)as i64;
let ig = (255.999*g)as i64;
let ib = (255.999*b)as i64;
println!("{} {} {}",ir,ig,ib);
n_count=n_count+1;
}
i_count=i_count-1;
}
}