Sourcery AI
71d02673a9
'Refactored by Sourcery'
2024-08-19 03:46:27 +03:00
JoeStrout
4a5686322a
Added MiniScript version of 60_Mastermind.
2023-09-13 09:44:56 -07:00
Anthony Rubick
12e6bc0b98
Merge branch 'coding-horror:main' into fixes_for_Mastermind
2022-05-01 11:25:22 -07:00
AnthonyMichaelTDM
9cb7c31fb1
bug fixes and logic changes
2022-04-30 17:35:17 -07:00
AnthonyMichaelTDM
4636e6543d
created new project w/ refactored Mastermind port
2022-04-30 17:20:36 -07:00
AnthonyMichaelTDM
54b2366076
create new project for a refactored mastermind
2022-04-30 14:32:45 -07:00
Joe Nellis
84fce13f35
Refactoring player turn and computer turn to separate methods. Computer turn logic previously ignored counting turns. Computer turn previously gave up the round if the user enters "inconsistent information" about the computers guess when it should have restarted the computers turn. Refactoring to remove usage of 'flag' variables to control program flow.
2022-04-30 01:31:59 -07:00
Joe Nellis
8bc2b33a58
Refactoring to distinguish setup of the game from the actual game. Changing globals to uppercase to signal constancy while assigning them via return from #setup_game. The two remaining mutable globals are for score keeping. Maintain commenting style of multistring inside method body.
2022-04-29 22:20:22 -07:00
Joe Nellis
cca3f941d2
More cleanup refactoring, losing unused variables, shadowed globals, unnecessary spaces, and long lines, and debug prints.
2022-04-29 17:34:31 -07:00
Joe Nellis
4308713ec2
Refactoring of the #get_possibility and #make_human_readable methods into one method, #possibility_to_color_code, that just converts a solution permutation (out of the possible permutations) straight into a string code of letters.
...
Both of these methods are essentially a flow of the first method being fed into the second and thus they are combined and the intermediate data structure (List[int]) is no longer needed.
2022-04-29 17:10:10 -07:00
Joe Nellis
44983bb25f
More off by 1 errors of the same type as the previous commit for the computer guessing the secret code. All errors are involved in the algortihm that converts an empty list to a guess.
2022-04-29 13:54:53 -07:00
AnthonyMichaelTDM
f745dad4b2
Rust: update comparison logic to follow README.md
...
will likely refactor this project later
2022-04-29 11:18:17 -07:00
Joe Nellis
bacad32a61
Off by one error in for/range. Previously if the computer chose a secret code of zero (all blacks) it would skip initialization entirely and the player would not be able to finish the puzzle. Alternatively, if the computer chose the highest secret code (e.g. all Red in a three color puzzle), the actual secret code would be initialized to one less (RRW).
2022-04-24 17:39:03 -07:00
Joe Nellis
5ff1717a53
Unfixes the fix introduced in a previous commit regarding how the computer deduces the answer. ReadMe updated with a thorough explanation of the deduction process.
2022-04-08 21:59:14 -07:00
Joe Nellis
b30fa59880
Mastermind port in java.
2022-04-08 14:05:39 -07:00
Martin Thoma
ac184fec42
Python: Type annotations
2022-04-02 10:56:43 +02:00
Martin Thoma
a561322962
Python: Add type annotations
2022-04-02 09:30:56 +02:00
Martin Thoma
4b3b991273
Use docstrings
2022-04-02 08:10:01 +02:00
Martin Thoma
1b1d50986b
Python: Add type annotations to all 'print' functions ( #662 )
...
* Add test to superstartrek and fixes several issues in superstartrek - I probably introduced them 🙈
* Mastermind type annotations
2022-03-21 10:41:14 +01:00
Jeff Atwood
f40a1fc465
add Porting Notes to readme.md for each game
2022-03-18 19:50:22 -07:00
Martin Thoma
f52d9a0e54
Clean Code: Python
...
Fix issues found by flake8-bugbear:
* Unused loop variables
* assert statements in non-test code
* mixing test code with production code
* mark one excessive test which takes ~10min to run
as 'slow'
2022-03-18 14:59:08 +01:00
Jeff Atwood
6f6ac93d1f
Merge pull request #633 from mojoaxel/js-terminal-style
...
Add "nice" terminal style stylesheet for javascript html
2022-03-15 23:50:18 -05:00
Jeff Atwood
43f2ec013a
add 00_Alternate_Langage folder and move alternate ports there
2022-03-15 20:49:07 -07:00
Alexander Wunschik
f2b3d6f2ed
add terminal-stylesheet for javascript html
2022-03-13 11:23:05 +01:00
Martin Thoma
4adb34f25c
Python: Fix code style issues
2022-03-11 07:44:56 +01:00
Martin Thoma
e7520d62af
MAINT: Apply 'pre-commit run --all' and fix issues
2022-03-10 06:59:21 +01:00
Anthony Rubick
4ff18ddb7b
Update README.md
2022-03-08 18:36:53 -08:00
Anthony Rubick
d970267743
Update README of 60_mastermind
...
updates the readme as suggested in #611
2022-03-08 13:23:31 -08:00
Jeff Atwood
ac9dc5dd02
Merge pull request #612 from AnthonyMichaelTDM/rust-port-66_Mastermind
...
Rust port 60_mastermind
2022-03-07 11:53:21 -06:00
Anthony Rubick
65a5d5987c
Merge branch 'main' into fix-logic-error-in-60_mastermind
2022-03-07 09:04:07 +00:00
AnthonyMichaelTDM
98f47dfa44
fix for potential logic error
...
should fix the conflict
2022-03-07 01:02:09 -08:00
AnthonyMichaelTDM
79e53c293b
while we're at it, fix the javascript port not showed guess results too
2022-03-07 00:58:30 -08:00
AnthonyMichaelTDM
eaff44a86a
fix for potential logic error
2022-03-07 00:35:18 -08:00
AnthonyMichaelTDM
84555d2ac8
finished rust port of 66_mastermind
2022-03-07 00:13:59 -08:00
AnthonyMichaelTDM
2291f074d3
rust port of 66_mastermind started
...
human as code breaker part done
2022-03-06 20:59:29 -08:00
Martin Thoma
e64fb6795c
MAINT: Apply pre-commit
...
Remove byte-order-marker pre-commit check as there would be
many adjustments necessary
2022-03-05 09:29:23 +01:00
Tom Wyant
c5ef9f42a2
Port 60_Mastermind to Perl.
2022-02-03 14:44:49 -05:00
Zev Spitz
ca9fafc758
Simplify Mastermind (C#) folder structure
2022-01-17 11:48:01 +02:00
Zev Spitz
75def2707d
Add sln and csroj/vbproj files where missing
2022-01-16 08:17:31 +02:00
LukasMurdock
76c5e1e995
add 17-96
2022-01-03 02:13:21 -05:00
Chris Reuter
d26dbf036a
Removed spaces from top-level directory names.
...
Spaces tend to cause annoyances in a Unix-style shell environment.
This change fixes that.
2021-11-21 18:30:21 -05:00