Data update
This commit is contained in:
parent
29a5eea0d4
commit
5c1bb7bfa9
2011 changed files with 35081 additions and 3229 deletions
|
|
@ -127,7 +127,7 @@ procedure Bulls_Player is
|
|||
function Has_To_Be_Removed (Position : Positive) return Boolean is
|
||||
Testant : constant Sequence := V.Element (Position);
|
||||
Bull_Score : Natural := 0;
|
||||
Cows_Score : Natural := 0;
|
||||
Cow_Score : Natural := 0;
|
||||
begin
|
||||
for I in Testant'Range loop
|
||||
for J in S'Range loop
|
||||
|
|
|
|||
18
Task/Bulls-and-cows-Player/Uiua/bulls-and-cows-player.uiua
Normal file
18
Task/Bulls-and-cows-Player/Uiua/bulls-and-cows-player.uiua
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Sets and plays a game of Bulls and Cows (Mastermind)
|
||||
|
||||
T ← [⍥(+1⌊×⚂9)4] # Random target
|
||||
# Score a guess against a target, or vice versa :-).
|
||||
Score ← (
|
||||
:⟜/+=,, # Find bulls.
|
||||
⊟⊙(/+↧∩(≡/+⊞=+1⇡9)∩▽⊙:.¬) # Find cows.
|
||||
)
|
||||
&p $"_ <- Target\n" T
|
||||
⍥(☇1⊞⊂.)2+1⇡9 # Proposed targets [1-9 1-9 1-9 1-9]
|
||||
⍢(
|
||||
|
||||
⟜(&p$"_\t_",,⟜(Score T)⊡⊸(⌊×⚂⧻)) # Pick from Ps, and play it against T
|
||||
▽:⟜(≡≍⊙¤≡Score⊙¤) # Only keep Ps that match that score
|
||||
| >1⧻
|
||||
)
|
||||
&p↯21@-
|
||||
&p $"_\t_" :⊸(⟨"UHOH"|"good"⟩≍T)⊢
|
||||
Loading…
Add table
Add a link
Reference in a new issue