Started TP3

This commit is contained in:
thatscringebro
2024-12-04 20:56:08 -05:00
parent 0e090d2402
commit ba312a3aef
3 changed files with 27 additions and 0 deletions

BIN
Session1/TP3/Tp3.pdf Normal file

Binary file not shown.

View File

@@ -0,0 +1,7 @@
[package]
name = "simon"
version = "0.1.0"
edition = "2021"
[dependencies]
rand = "0.8.5"

View File

@@ -0,0 +1,20 @@
use rand::prelude::*;
fn main() {
println!("Hello, world!");
let turns: Vec<i8> = gen_turn_array();
for turn in turns {
println!("{}", turn);
}
}
fn gen_turn_array() -> Vec<i8> {
let mut rng = rand::thread_rng();
let mut vec = Vec::with_capacity(255);
for _ in 0..255 {
vec.push(rng.gen_range(1..5));
}
return vec;
}