mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-23 07:29:02 -08:00
fixed drawing
This commit is contained in:
@@ -5,10 +5,14 @@ pub fn generate_disks(amount: u8) -> Vec<Disk> {
|
||||
println!("CANNOT HAVE MORE THAN 7 DISKS!");
|
||||
}
|
||||
|
||||
// check for if amount == 0
|
||||
|
||||
let mut disks = Vec::new();
|
||||
|
||||
for i in (1..=amount).rev() {
|
||||
disks.push(Disk::new(i * 2 + 1));
|
||||
let mut half_size = 7;
|
||||
for _ in (1..=amount).rev() {
|
||||
disks.push(Disk::new(half_size * 2 + 1));
|
||||
half_size -= 1;
|
||||
}
|
||||
|
||||
disks
|
||||
|
||||
Reference in New Issue
Block a user