Pluralize victory message correctly

This commit is contained in:
Juhani Krekelä 2022-02-24 21:38:54 +02:00
parent ae8e8e69ce
commit a3e699a391
1 changed files with 14 additions and 3 deletions

View File

@ -413,9 +413,19 @@ victory:
mov ah, 2 mov ah, 2
int 0x21 int 0x21
mov dx, guesses_str cmp byte [guesses], 1
mov ah, 9 je .singular
int 0x21
.plural:
mov dx, guesses_str
jmp .print
.singular:
mov dx, guess_str
.print:
mov ah, 9
int 0x21
exit: exit:
ret ret
@ -745,6 +755,7 @@ erase_word_str db ' $'
word_was_str db 'The word was: $' word_was_str db 'The word was: $'
correct_in_str db 'Correct in $' correct_in_str db 'Correct in $'
guesses_str db ' guesses.$' guesses_str db ' guesses.$'
guess_str db ' guess.$'
%include "dictionary.inc" %include "dictionary.inc"
%include "targets.inc" %include "targets.inc"