Bulls and cows: Difference between revisions

m
(Add VTL-2)
Line 7,140:
=={{header|Transd}}==
{{trans|C++}}
<syntaxhighlight lang="scheme">#lang transd
#lang transd
 
MainModule: {
Line 7,150 ⟶ 7,149:
),
 
play: (λ locals:
syms "0123456789"
len 4
Line 7,170 ⟶ 7,169:
(with bulls 0 cows 0 pl 0
(for i in Range(len) do
(= pl (findsearch thenum (subn guess i)))
(if (eq pl i) (+= bulls 1)
elsif (neq pl -1) (+= cows 1))
Line 7,184 ⟶ 7,183:
),
 
_start: (λ locals: s String()
(lout "Welcome to \"Bulls and cows\"!")
(while true
(while true
(textout "Do you want to play? (yes|no) : ")
(textingetline s 3)
(if (not (size s))
(lout "Didn't receive an answer. Exiting.") (exit)
Line 7,198 ⟶ 7,197:
(play)
(lout "Another game?")
)
)
}</syntaxhighlight>
}
 
</syntaxhighlight>
=={{header|TUSCRIPT}}==
<syntaxhighlight lang="tuscript">
111

edits