This commit is contained in:
Llywelwyn 2023-07-24 04:32:56 +01:00
parent 0472c8a8bf
commit 1c435f8d60
3 changed files with 11 additions and 4 deletions

View file

@ -176,7 +176,10 @@ pub fn print_options(inventory: BTreeMap<(String, String), i32>, mut y: i32, ctx
x += 2;
ctx.print(x, y, name.1.to_string());
} else {
if ['a', 'e', 'i', 'o', 'u'].iter().any(|&v| name.0.starts_with(v)) {
if name.0.ends_with("s") {
ctx.print(x, y, "some");
x += 5;
} else if ['a', 'e', 'i', 'o', 'u'].iter().any(|&v| name.0.starts_with(v)) {
// If one and starts with a vowel, print 'an'
// i.e. (a) an apple
ctx.print(x, y, "an");