Bulls and cows: Difference between revisions
m
→Update Transd to the current version
Not a robot (talk | contribs) (Add VTL-2) |
|||
Line 7,140:
=={{header|Transd}}==
{{trans|C++}}
<syntaxhighlight lang="scheme">#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 (
(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) : ")
(
(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">
|