Data update

This commit is contained in:
Ingy döt Net 2024-07-13 15:19:22 -07:00
parent 29a5eea0d4
commit 5c1bb7bfa9
2011 changed files with 35081 additions and 3229 deletions

View file

@ -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

View 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)⊢