Advertisement
T3RRYT3RR0R

Rapid Codebreaker for mastermind game

Jul 2nd, 2020
536
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.90 KB | None | 0 0
  1. @Rem // code cracking cheat for Mastermind Game: https://pastebin.com/UXs2Hbm2
  2. @Echo Off & Setlocal DisableDelayedExpansion
  3. Set "Chars=1234567890qwertyuiopasdfghjklzxcvbnmMNBVCXZASDFGHJKLPOIUYTREWQ'/\@#$&"
  4. Set "Code=%1"
  5. :GetCode
  6. IF "%Code%"=="" (Set /P "Code=Code: " & Goto :GetCode)
  7. Setlocal EnableDelayedExpansion
  8. Set "CodeLen=start"
  9. For /L %%I in (1,1,60) Do IF "!Code:~%%I,1!"=="" If "!CodeLen!"=="start" Set "CodeLen=%%I"
  10. For /L %%I in (1 1 !CodeLen!) Do Set "C#%%I=!Chars!"
  11. Call :Crack
  12. Echo/
  13. Echo/Cracked Code: !Cracked!
  14. Endlocal
  15. Endlocal
  16. exit /B
  17. :Crack
  18.     Set Cracked=
  19.     Set CTF=
  20.     For /L %%I in (1 1 !CodeLen!) Do (
  21.         Set /A POS=%%I-1
  22.         For %%P in (!POS!) Do If /I "!C#%%I:~0,1!"=="!Code:~%%P,1!" (
  23.             Set /A CTF+=1
  24.             Set "Cracked=!Cracked!!C#%%I:~0,1!"
  25.         ) Else (
  26.             For /F "Delims=" %%E in ("!C#%%I:~0,1!") Do Set "C#%%I=!C#%%I:%%E=!"
  27.         )
  28.     )
  29.     IF !CTF! EQU !CodeLen! (Exit /B)
  30. Goto :Crack
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement