Disallow zeros

This commit is contained in:
Daniel Flanagan 2024-05-03 13:54:34 -05:00
parent 70df5770fb
commit fccaf317d8

View file

@ -27,7 +27,17 @@ fn ticket_from_str(s: &str) -> Result<Ticket, anyhow::Error> {
num5.unwrap()?,
];
if r[0] > 90 || r[1] > 90 || r[2] > 90 || r[3] > 90 || r[4] > 90 {
if r[0] < 1
|| r[1] < 1
|| r[2] < 1
|| r[3] < 1
|| r[4] < 1
|| r[0] > 90
|| r[1] > 90
|| r[2] > 90
|| r[3] > 90
|| r[4] > 90
{
return Err(anyhow!("lotto number too high"));
}