κ°μ₯ μ΅κ·Ό 리λ 보λ @ 2014-08-02 12:00
| Pos # | Author | Name | Language | Score | Win | Draw | Loss | Avg. Dec. Time |
+-------+----------------------+-------------------------+------------+-------+-------+-------+-------+----------------+
| 1st | Emil | Pony | Python2 | 064 | 064 | 000 | 005 | 0026.87 ms |
| 2nd | Roy van Rijn | Gazzr | Java | 062 | 062 | 001 | 006 | 0067.30 ms |
| 2nd | Emil | Dienstag | Python2 | 062 | 062 | 001 | 006 | 0022.19 ms |
| 4th | ovenror | TobiasFuenke | Python2 | 061 | 061 | 001 | 007 | 0026.89 ms |
| 5th | PhiNotPi | BayesianBot | Perl | 060 | 060 | 000 | 009 | 0009.27 ms |
| 6th | Claudiu | SuperMarkov | Python2 | 058 | 058 | 001 | 010 | 0026.77 ms |
| 7th | histocrat | Alternator | Ruby | 057 | 057 | 001 | 011 | 0038.53 ms |
| 8th | histocrat | LeonardShelby | Ruby | 053 | 053 | 000 | 016 | 0038.55 ms |
| 9th | Stretch Maniac | SmarterBot | Java | 051 | 051 | 002 | 016 | 0070.02 ms |
| 9th | Martin BΓΌttner | Markov | Ruby | 051 | 051 | 003 | 015 | 0038.45 ms |
| 11th | histocrat | BartBot | Ruby | 049 | 049 | 001 | 019 | 0038.54 ms |
| 11th | kaine | ExcitingishBot | Java | 049 | 049 | 001 | 019 | 0065.87 ms |
| 13th | Thaylon | UniformBot | Ruby | 047 | 047 | 001 | 021 | 0038.61 ms |
| 14th | Carlos Martinez | EasyGame | Java | 046 | 046 | 002 | 021 | 0066.44 ms |
| 15th | Stretch Maniac | SmartBot | Java | 045 | 045 | 001 | 023 | 0068.65 ms |
| 16th | Docopoper | RoboticOboeBotOboeTuner | Python2 | 044 | 044 | 000 | 025 | 0156.55 ms |
| 17th | Qwix | Analyst | Java | 043 | 043 | 001 | 025 | 0069.06 ms |
| 18th | histocrat | Analogizer | Ruby | 042 | 042 | 000 | 027 | 0038.58 ms |
| 18th | Thaylon | Naan | Ruby | 042 | 042 | 004 | 023 | 0038.48 ms |
| 20th | Thaylon | NitPicker | Ruby | 041 | 041 | 000 | 028 | 0046.21 ms |
| 20th | bitpwner | AlgorithmBot | Python2 | 041 | 041 | 001 | 027 | 0025.34 ms |
| 22nd | histocrat | WereVulcan | Ruby | 040 | 040 | 003 | 026 | 0038.41 ms |
| 22nd | Ourous | QQ | Cobra | 040 | 040 | 003 | 026 | 0089.33 ms |
| 24th | Stranjyr | RelaxedBot | Python2 | 039 | 039 | 001 | 029 | 0025.40 ms |
| 25th | JoshDM | SelfLoathingBot | Java | 038 | 038 | 001 | 030 | 0068.75 ms |
| 25th | Ourous | Q | Cobra | 038 | 038 | 001 | 030 | 0094.04 ms |
| 25th | Ourous | DejaQ | Cobra | 038 | 038 | 001 | 030 | 0078.31 ms |
| 28th | Luis Mars | Botzinga | Java | 037 | 037 | 002 | 030 | 0066.36 ms |
| 29th | kaine | BoringBot | Java | 035 | 035 | 000 | 034 | 0066.16 ms |
| 29th | Docopoper | OboeBeater | Python2 | 035 | 035 | 002 | 032 | 0021.92 ms |
| 29th | Thaylon | NaanViolence | Ruby | 035 | 035 | 003 | 031 | 0038.46 ms |
| 32nd | Martin BΓΌttner | SlowLizard | Ruby | 034 | 034 | 004 | 031 | 0038.32 ms |
| 33rd | Kyle Kanos | ViolentBot | Python3 | 033 | 033 | 001 | 035 | 0032.42 ms |
| 34th | HuddleWolf | HuddleWolfTheConqueror | .NET | 032 | 032 | 001 | 036 | 0029.86 ms |
| 34th | Milo | DogeBotv2 | Java | 032 | 032 | 000 | 037 | 0066.74 ms |
| 34th | Timmy | DynamicBot | Python3 | 032 | 032 | 001 | 036 | 0036.81 ms |
| 34th | mccannf | YAARBot | JS | 032 | 032 | 002 | 035 | 0100.12 ms |
| 38th | Stranjyr | ToddlerProof | Java | 031 | 031 | 010 | 028 | 0066.10 ms |
| 38th | NonFunctional User2..| IHaveNoIdeaWhatImDoing | Lisp | 031 | 031 | 002 | 036 | 0036.26 ms |
| 38th | john smith | RAMBOBot | PHP | 031 | 031 | 002 | 036 | 0014.53 ms |
| 41st | EoinC | SimpleRandomBot | .NET | 030 | 030 | 005 | 034 | 0015.68 ms |
| 41st | Martin BΓΌttner | FairBot | Ruby | 030 | 030 | 006 | 033 | 0038.23 ms |
| 41st | Docopoper | OboeOboeBeater | Python2 | 030 | 030 | 006 | 033 | 0021.93 ms |
| 44th | undergroundmonorail | TheGamblersBrother | Python2 | 029 | 029 | 000 | 040 | 0025.55 ms |
| 45th | DrJPepper | MonadBot | Haskel | 028 | 028 | 002 | 039 | 0008.23 ms |
| 46th | Josef E. | OneBehind | Java | 027 | 027 | 007 | 035 | 0065.87 ms |
| 47th | Ourous | GitGudBot | Cobra | 025 | 025 | 001 | 043 | 0053.35 ms |
| 48th | ProgramFOX | Echo | .NET | 024 | 024 | 004 | 041 | 0014.81 ms |
| 48th | JoshDM | SelfHatingBot | Java | 024 | 024 | 005 | 040 | 0068.88 ms |
| 48th | Trimsty | Herpetologist | Python3 | 024 | 024 | 002 | 043 | 0036.93 ms |
| 51st | Milo | DogeBot | Java | 022 | 022 | 001 | 046 | 0067.86 ms |
| 51st | William Barbosa | StarWarsFan | Ruby | 022 | 022 | 002 | 045 | 0038.48 ms |
| 51st | Martin BΓΌttner | ConservativeBot | Ruby | 022 | 022 | 001 | 046 | 0038.25 ms |
| 51st | killmous | MAWBRBot | Perl | 022 | 022 | 000 | 047 | 0016.30 ms |
| 55th | Mikey Mouse | LizardsRule | .NET | 020 | 020 | 007 | 042 | 0015.10 ms |
| 55th | ja72 | BlindForesight | .NET | 020 | 020 | 001 | 048 | 0024.05 ms |
| 57th | robotik | Evolver | Lua | 019 | 019 | 001 | 049 | 0008.19 ms |
| 58th | Kyle Kanos | LexicographicBot | Python3 | 018 | 018 | 003 | 048 | 0036.93 ms |
| 58th | William Barbosa | BarneyStinson | Lua | 018 | 018 | 005 | 046 | 0005.11 ms |
| 60th | Dr R Dizzle | BartSimpson | Ruby | 017 | 017 | 001 | 051 | 0038.22 ms |
| 60th | jmite | IocainePowder | Ruby | 017 | 017 | 003 | 049 | 0038.50 ms |
| 60th | ArcticanAudio | SpockOrRock | PHP | 017 | 017 | 001 | 051 | 0014.19 ms |
| 60th | Dr R Dizzle | BetterLisaSimpson | Ruby | 017 | 017 | 000 | 052 | 0038.23 ms |
| 64th | Dr R Dizzle | LisaSimpson | Ruby | 016 | 016 | 002 | 051 | 0038.29 ms |
| 65th | Martin BΓΌttner | Vulcan | Ruby | 015 | 015 | 001 | 053 | 0038.26 ms |
| 65th | Dr R Dizzle | Khaleesi | Ruby | 015 | 015 | 005 | 049 | 0038.29 ms |
| 67th | Dr R Dizzle | EdwardScissorHands | Ruby | 014 | 014 | 002 | 053 | 0038.21 ms |
| 67th | undergroundmonorail | TheGambler | Python2 | 014 | 014 | 002 | 053 | 0025.47 ms |
| 69th | cipher | LemmingBot | Python2 | 011 | 011 | 002 | 056 | 0025.29 ms |
| 70th | Docopoper | ConcessionBot | Python2 | 007 | 007 | 000 | 062 | 0141.31 ms |
+-------+----------------------+-------------------------+------------+-------+-------+-------+-------+----------------+
Total Players: 70
Total Matches Completed: 2415
Total Tourney Time: 06:00:51.6877573
ν λλ¨ΌνΈ λ ΈνΈ
- μ°ν 70 λ΄
- Emilμ μ¬μ ν ββKOTH
Ponyμ΄λ©° κ·Έμ μλ‘μ΄ λ΄Dienstagμ 3 μλ₯Ό μ°¨μ§ν©λλ€. - λ‘μ΄μκ²
Gazzrλ΄ μΌλ‘ 2 μλ‘ λ°μ΄ λ€μ΄ μ€ κ²μ μΆνν©λλ€ - William Barbosa, λ΄μΌλ‘ Quick Draw μ μμ
BarneyStinson -
κ·Έλ¦¬κ³ Slow Poke μμ κ·Έμ λ‘λ΄
R.O.B.O.Tκ³ΌConcessionbotνΈλ λΉ> 140ms μΈ Docopoperμκ² μμ¬λ©λλ€. -
μ¬μ© κ°λ₯ν λ‘κ·Έ : https://github.com/eoincampbell/big-bang-game/blob/master/tourneys/Tournament-2014-08-01-23-24-00.zip?raw=true
μ μΈ λ λ΄
- BashRocksBot-cygwin bash μ€ν¬λ¦½νΈλ₯Ό μ€ννλ .netμλ μ¬μ ν κΈ°μ¨μ΄ μμ΅λλ€.
- CounterPreferenceBot-λ²κ·Έ μμ λκΈ° μ€
- RandomlyWeighted-λ²κ·Έ μμ μ κΈ°λ€λ¦¬λ μ€
- CasinoShakespeare-μΈν°λ· μ°κ²°μ΄ νμνλ―λ‘ μ μΈ
μλ κ²μ λ μ§λ¬Έ
λΉμ μ λ°μ, μ’ μ΄, κ°μ, λλ§λ±, μ€νμ κ°μ₯ μμ¬μ λκ²° μ ν¬λ₯Ό μν΄ μΉκ΅¬ μ§μΌλ‘ λμ μμ΅λλ€. μ§μ ν BigBang κ΄΄μν μ€νμΌμμλ μ΄λ€ μ μλ μ€μ€λ‘ κ²½κΈ°λ₯Όνμ§ μμ§λ§ λμ μ½μ λ΄μ λ§λ€μ΄ λμ΅λλ€. USB ν€λ₯Ό κΊΌλ΄μ μ 볡μ μκ² λ겨 λκ²°μ ν¬ν¨μν΅λλ€. νλ μ€ oon. λλ νμλκ° κΈ°μ νμ μλ μμ΅λλ€. μ°λ¦¬λ μ¬κΈ° λ λλμ μννΈμμ νλ¨νμ§ μμ΅λλ€.
κ·μΉ
νμ€ λ°μ, μ’ μ΄, κ°μ, λλ§λ±, μ€ν κ·μΉμ΄ μ μ©λ©λλ€.
- κ°μ μλΌ μ’ μ΄
- μ’ μ΄ μ»€λ² λ½
- λ°μλ λλ§λ±μ λΆμ
- λλ§λ± λ
- μ€νμ€ ββκ°μ
- κ°μλ λλ§λ±μ ν΄λ ν©λλ€
- λλ§λ±μ μ’ μ΄λ₯Ό λ¨Ήλλ€
- μ€νμ μ’ μ΄λ₯Ό λ°μ¦νλ€
- μ€νμ λ°μλ₯Ό κΈ°νμν¨λ€
- κ°μ λΆμκΈ°

κ° νλ μ΄μ΄μ λ΄μ ν λλ¨ΌνΈμμ μλ‘ λ€λ₯Έ λ΄κ³Ό νλμ κ²½κΈ° λ₯Όν©λλ€.
κ° κ²½κΈ°λ 100 ν λ°λ³΅ λ RPSLV κ²μμΌλ‘ ꡬμ±λ©λλ€.
κ° κ²½κΈ°κ° λλλ©΄ 100 μ λ§μ μ κ°μ₯ λ§μ κ²μ / νΈλλ₯Ό μ»μ μ μκ° μΉμκ°λ©λλ€.
κ²½κΈ°μμ μ΄κΈ°λ©΄ 리그 ν μ΄λΈμμ 1 μ μλ°μ΅λλ€. λλ‘μ° λ§€μΉμ κ²°κ³Όλ‘ μ΄λ νλ μ΄μ΄λ μ μλ₯Ό μ»μ§ λͺ»ν©λλ€.
λ΄ μꡬ μ¬ν
λ΄μ λͺ λ Ή μ€μμ μ€νν μ μμ΄μΌν©λλ€.
Sheldorμ * nix λ°μ€κ° μ£½μμΌλ―λ‘ Windows 8 Gaming Laptopμμ μ€ννλ―λ‘ μ 곡λ μ루μ μ΄ Windowsμμ μ€νλ μ μλμ§ νμΈνμμμ€. Sheldorλ μ루μ μ μ€νν μ μλλ‘ νμν λ°νμμ μ΄μ μμ΄ μ€μΉνλλ‘ κΈ°κΊΌμ΄ μ μνμ΅λλ€. (.NET, Java, Php, Python, Ruby, Powershell β¦)
μ λ ₯
κ° κ²½κΈ°μ 첫 κ²½κΈ°μμλ λ΄μ μΈμκ° μ 곡λμ§ μμ΅λλ€. κ° κ²½κΈ°μ κ° νμ κ²μμμ :-Arg1μμ΄ κ²½κΈ°μμ λ΄ νΈλ / κ²°μ μ μ΄λ ₯μ ν¬ν¨ν©λλ€. -Arg2λμ΄ κ²½κΈ°μμ μλ νΈλ / κ²°μ μ μ΄λ ₯μ ν¬ν¨ν©λλ€.
μμ¬λ μ°μ£Ό ν μμλ μμ λνλ΄λ μΌλ ¨μ λ¨μΌ λλ¬Έμλ‘ νμλ©λλ€.
| R | Rock |
| P | Paper |
| S | Scissors |
| L | Lizard |
| V | Spock |
μ :
- κ²μ 1 : MyBot.exe
- κ²μ 2 : MyBot.exe SV
- κ²μ 3 : MyBot.exe SS VL
- κ²μ 4 : MyBot.exe SSR VLS
μ°μΆ
λ΄μ κ° κ²μμ βμβμ λνλ΄λ λ¨μΌ λ¬Έμ μλ΅μ μμ±ν΄μΌν©λλ€. κ²°κ³Όλ STDOUTμ κΈ°λ‘λκ³ λ΄μ μ’ λ£ν΄μΌν©λλ€. μ ν¨ν λ¨μΌ λλ¬Έμλ λ€μκ³Ό κ°μ΅λλ€.
| R | Rock |
| P | Paper |
| S | Scissors |
| L | Lizard |
| V | Spock |
λ΄μ΄ μ ν¨ν νΈλλ₯Ό λ°ννμ§ μλ κ²½μ° (μ : μμ 5 κ°μ λ¨μΌ λλ¬Έμ μ€ νλ), ν΄λΉ νΈλλ₯Ό μλμΌλ‘ λͺ°μ λ΄κ³ κ²½κΈ°λ κ³μλ©λλ€.
λ λ΄μ΄ λͺ¨λ μ ν¨ν νΈλλ₯Ό λ°ννμ§ μμΌλ©΄ κ²μμ 무μΉλΆλ‘ κ°μ£Όλλ©° κ²½κΈ°λ κ³μλ©λλ€.
κ²½κΈ° νμ
μ μΆ λ κ° λ΄μ ν λλ¨ΌνΈμμ μλ‘ λ€λ₯Έ λ΄κ³Ό νλμ κ²½κΈ°λ₯Όν©λλ€.
κ° κ²½κΈ°λ μ νν 100 κ²μ μ§μλ©λλ€.
μν©μ μ΅λͺ μΌλ‘ μ§νλλ©°, μλνλ νΉμ λ΄μ λν κ³ κΈ μ§μμ μμ§λ§ νμ¬ μν© κΈ°λ‘μμ μμ μ μμ¬ κ²°μ μμ μ»μ μμλ λͺ¨λ μ 보λ₯Ό μ¬μ©νμ¬ μλ. ν¨ν΄ / ν΄λ¦¬μ€ν± λ±μ ꡬμΆνκΈ° μν΄ μ΄μ κ²μμ κΈ°λ‘μ μΆμ ν μλ μμ΅λλ€ (μλ κ·μΉ μ°Έμ‘°).
λ¨μΌ κ²μ λμ μ€μΌμ€νΈλ μ΄μ μμ§μ λ΄κ³Ό μλ λ΄μ 100 λ°λ¦¬ μ΄ κ°κ²©μΌλ‘ μ€ν ν λ€μ λμΌν μΈμ΄ / λ°νμμμ PRNG μΆ©λμ νΌνκΈ° μν΄ κ²°κ³Όλ₯Ό λΉκ΅ν©λλ€. (μ΄κ²μ μ€μ λ‘ ν μ€νΈ μ€μ λμκ² λ°μνμ΅λλ€).
μ¬μ¬ λ° μ μ½
μ 볡μ Sheldorμ λͺ¨μ΅μΌλ‘ Sheldon Cooper λ°μ¬λ ν λλ¨ΌνΈ μ΄μμ κ°λ νκΈ° μν΄ μΉμ νκ² μ μνμ΅λλ€. μ 볡μ μλλ 곡μ νκ³ κ°λ μμ λλ€ (μ£Όλ‘). Sheldorμ λͺ¨λ κ²°μ μ μ΅μ’ κ²°μ μ λλ€.
κ²μμ 곡μ νκ³ μ μ ν λ°©μμΌλ‘ μνλ©λλ€.
- λ΄ μ€ν¬λ¦½νΈ / νλ‘κ·Έλ¨μ νμ ν΄λ μλ μ€μΌμ€νΈλ μ΄μ
μμ§μ μ μ₯λ©λλ€.
Players\[YourBotName]\ - νμ ν΄λ
Players\[YourBotName]\dataλ₯Ό μ¬μ©νμ¬ μ§νμ€μΈ νμ¬ ν λλ¨ΌνΈμ λ°μ΄ν° λλ κ²μ κΈ°λ‘μ κΈ°λ‘ ν μ μμ΅λλ€ . λ°μ΄ν° λλ ν 리λ ν λλ¨ΌνΈκ° μμλ λλ§λ€ μ κ±°λ©λλ€. - ν λλ¨ΌνΈμμ λ€λ₯Έ νλ μ΄μ΄μ νλ μ΄μ΄ λλ ν 리μ μ‘μΈμ€ ν μ μμ΅λλ€
- λ΄μ λ€λ₯Έ νΉμ λ΄ λμμ λμμΌλ‘νλ νΉμ μ½λλ₯Ό κ°μ§ μ μμ΅λλ€
- κ° νλ μ΄μ΄λ μλ‘ μνΈ μμ©νκ±°λ λμμ£Όμ§ μλ ν λ μ΄μμ λ΄μ μ μΆνμ¬ νλ μ΄ ν μ μμ΅λλ€.
νΈμ§-μΆκ° μ μ½
- μμ€μ λν΄μλ μ§μλμ§ μμ΅λλ€. λ΄μ 5 κ°μ μ ν¨ν νΈλ μ€ νλλ₯Ό νλ μ΄ν΄μΌν©λλ€. ν λλ¨ΌνΈ μΈλΆμ κ° λ΄μ 무μμ λ°μ΄ν°λ‘ ν μ€νΈνμ¬ λμνλμ§ νμΈν©λλ€. μ€λ₯ (μ : μ€λ₯λ₯Ό μμ΄λ²λ¦°)λ₯Ό λμ§λ λ΄μ λ²κ·Έκ° μμ λ λκΉμ§ ν λλ¨ΌνΈμμ μ μΈλ©λλ€.
- λ΄μ νλμ΄ κ°κ²°νκ² λ€λ₯Έ ν νμμ μΌ μ μμ΅λλ€. κΈ°μ‘΄ λ΄κ³Ό μ νν λμΌν λμμ μννλ λ΄ (λ€λ₯Έ μΈμ΄ ν¬ν¨)μ μ€κ²© μ²λ¦¬λ©λλ€.
- λ€μμ λν μ€νΈ λ΄μ΄ μ΄λ―Έ μμΌλ―λ‘ λ€μ μ μΆνμ§ λ§μμμ€.
-
- λ½-λ°νΈ μ¬μ¨
-
- μ’ μ΄-LisaSimpson
-
- κ°μ-EdwardScissoror
-
- μ€ν-λ²μ»¨
-
- λλ§λ±-칼리μ
-
- μμ¬ λλ€-SimpleRandomBot λ° FairBot
-
- μλ λλ€ RPS-보μμ μΈ λ΄
-
- μλ λλ€ LV-λ°λ μ€ν΄ μ¨
- λ΄μ νμ¬ μλΉμ€ λλ μΉ λ¦¬μμ€ (λλ κ²½κΈ°μ μλ / μμ¬ κ²°μ μκ°μ ν¬κ² λ리κ²νλ κΈ°ν)λ₯Ό λΆλ¬ λΌ μ μμ΅λλ€.
CasinoShakespeareμ΄ μ μ½ μ‘°κ±΄μ΄ μΆκ°λκΈ° μ μ λ΄μ΄ μ μΆ λ μ μΌν μμΈμ λλ€.
λ λ§μ λ΄μ΄ μ μΆλ¨μ λ°λΌ, Sheldorλ ν λλ¨ΌνΈ κ²°κ³Όλ₯Ό μ΅λν μμ£Ό μ λ°μ΄νΈν©λλ€.
μ€μΌμ€νΈλ μ΄μ / μ μ΄ νλ‘κ·Έλ¨
κ° λ΄μ λν μμ€ μ½λμ ν¨κ» μ€μΌμ€νΈλ μ΄μ νλ‘κ·Έλ¨μ githubμμ μ 곡λ©λλ€.
https://github.com/eoincampbell/big-bang-game
μ μΆ μΈλΆ μ¬ν
μ μΆλ¬Όμλ λ€μμ΄ ν¬ν¨λμ΄μΌν©λλ€.
- λΉμ μ λ΄ μ΄λ¦
- κ·νμ μ½λ
- μ λͺ
λ Ή
- μμμ λ΄μ μ€ννμμμ€.
- λ£¨λΉ myBot.rb
- python3 myBot.py
- λλ
- λ¨Όμ λ λ€ μ»΄νμΌ ν λ€μ μ€ννμμμ€. μ :
- csc.exe MyBot.cs
- MyBot.exe
μν μ μΆ
BotName: SimpleRandomBot
Compile: "C:\Program Files (x86)\MSBuild\12.0\Bin\csc.exe" SimpleRandomBot.cs
Run: SimpleRandomBot [Arg1] [Arg2]
μνΈ:
using System;
public class SimpleRandomBot
{
public static void Main(string[] args)
{
var s = new[] { "R", "P", "S", "L", "V" };
if (args.Length == 0)
{
Console.WriteLine("V"); //always start with spock
return;
}
char[] myPreviousPlays = args[0].ToCharArray();
char[] oppPreviousPlays = args[1].ToCharArray();
Random r = new Random();
int next = r.Next(0, 5);
Console.WriteLine(s[next]);
}
}
μ€λͺ
μ§λ¬Έμ΄ μμΌμλ©΄ μλ μ견μ λ¬Έμνμμμ€.
λ΅λ³
μ‘°λλ§ (Python 2)
μ΄κ²μ Udacity μ¨λΌμΈ μμ μ΄ λλ λ νλ‘κ·Έλλ° λμ μ μν΄ μΌλ§ μ μ μ΄ λ°μ μ’ μ΄ κ°μ λ΄μ κΈ°λ°μΌλ‘ν©λλ€ . Spockκ³Ό λλ§λ±μ ν¬ν¨νλλ‘ λ³κ²½νκ³ κ°μ νμ΅λλ€.
μ΄ νλ‘κ·Έλ¨μλ 11 κ°μ§ κ°λ¨ν μ λ΅μ΄ μμΌλ©° κ°κ° 5 κ°μ§ λ³νμ΄ μμ΅λλ€. λ§μ§λ§ λΌμ΄λμμ μΌλ§λ μ μννλμ§μ λ°λΌ μ΄λ€ μ€μμ μ νν©λλ€.
λλ λ κ°ν μλμ λν΄ λ¬΄μμλ‘ μ¬μλλ λ체 μ λ΅μ μ κ±°νμ΅λλ€. λ μ¬λ―Έμμ κ² κ°μμ.
import sys
# just play Spock for the first two rounds
if len(sys.argv)<2 or len(sys.argv[1])<2: print 'V'; sys.exit()
# initialize and translate moves to numbers for better handling:
my_moves, opp_moves = sys.argv[1], sys.argv[2]
moves = ('R', 'P', 'S', 'V', 'L')
history = zip([moves.index(i) for i in my_moves],
[moves.index(i) for i in opp_moves])
# predict possible next moves based on history
def prediction(hist):
N = len(hist)
# find longest match of the preceding moves in the earlier history
cand_m = cand_o = cand_b = range(N-1)
for l in xrange(1,min(N, 20)):
ref = hist[N-l]
cand_m = ([c for c in cand_m if c>=l and hist[c-l+1][0]==ref[0]]
or cand_m[-1:])
cand_o = ([c for c in cand_o if c>=l and hist[c-l+1][1]==ref[1]]
or cand_o[-1:])
cand_b = ([c for c in cand_b if c>=l and hist[c-l+1]==ref]
or cand_b[-1:])
# analyze which moves were used how often
freq_m, freq_o = [0]*5, [0]*5
for m in hist:
freq_m[m[0]] += 1
freq_o[m[1]] += 1
# return predictions
return ([hist[-i][p] for i in 1,2 for p in 0,1]+ # repeat last moves
[hist[cand_m[-1]+1][0], # history matching of my own moves
hist[cand_o[-1]+1][1], # history matching of opponent's moves
hist[cand_b[-1]+1][0], # history matching of both
hist[cand_b[-1]+1][1],
freq_m.index(max(freq_m)), # my most frequent move
freq_o.index(max(freq_o)), # opponent's most frequent move
0]) # good old rock (and friends)
# what would have been predicted in the last rounds?
pred_hist = [prediction(history[:i]) for i in xrange(2,len(history)+1)]
# how would the different predictions have scored?
n_pred = len(pred_hist[0])
scores = [[0]*5 for i in xrange(n_pred)]
for pred, real in zip(pred_hist[:-1], history[2:]):
for i in xrange(n_pred):
scores[i][(real[1]-pred[i]+1)%5] += 1
scores[i][(real[1]-pred[i]+3)%5] += 1
scores[i][(real[1]-pred[i]+2)%5] -= 1
scores[i][(real[1]-pred[i]+4)%5] -= 1
# return best counter move
best_scores = [list(max(enumerate(s), key=lambda x: x[1])) for s in scores]
best_scores[-1][1] *= 1.001 # bias towards the simplest strategy
if best_scores[-1][1]<0.4*len(history): best_scores[-1][1] *= 1.4
strat, (shift, score) = max(enumerate(best_scores), key=lambda x: x[1][1])
print moves[(pred_hist[-1][strat]+shift)%5]
λ€μμΌλ‘ μ€ν :
python Pony.py
νΈμ§ : λλ νμ€νμ§ μμ κ²½μ° κ°μ₯ κ°λ¨ν μ λ΅ (μ¦, νμ κ°μ μμ§μμ μ·¨ν¨)μ νΈκ²¬μ λμ΄ μ¬μν λ³κ²½μκ°νμ΅λλ€. μ΄κ²μ ConservativeBotκ³Ό κ°μ λ΄κ³Ό κ°μ κ³³μμ μ§λμΉκ² 볡μ‘ν ν¨ν΄μ μ°Ύμ§ μλλ‘ λμμ€λλ€.
μ°Έκ³ :μ΄ λ΄μ΄ λ€λ₯Έ λ΄ Dienstag μ λν κ²μλ¬Όμμ μ¬μ©νλ κΈ°λ³Έ κΈ°λ‘ μΌμΉ μ λ΅μ μ€λͺ νλ €κ³ νμ΅λλ€ .
λ΅λ³
λ§λ₯΄μ½ν, 루λΉ
μλλ°©μ λ§μ§λ§ λ μμ§μμλ³΄κ³ κ°λ₯ν (κ·Έλ¦¬κ³ κ°μ₯ κ°λ₯μ±μ΄ λμ) νμ μ‘°μΉλ₯Ό κ²°μ ν©λλ€. λ§μ½ μ‘°ν©μ΄ μ΄μ μ μ νλμ§ μμλ€λ©΄, κ·Έλ μλλ°©μ λͺ¨λ μμ§μ (μ§κΈκΉμ§)μ λμ μ¬μ©ν©λλ€. κ·Έλ° λ€μ κ°λ₯ν λͺ¨λ μλ΅μ μμ§νκ³ μμμ μλ΅μ μ νν©λλ€.
responses = {
'R' => ['P', 'V'],
'P' => ['S', 'L'],
'S' => ['R', 'V'],
'L' => ['S', 'R'],
'V' => ['P', 'L']
}
if ARGV.length == 0 || (history = ARGV[1]).length < 3
choices = ['R','P','S','L','V']
else
markov = Hash.new []
history.chars.each_cons(3) { |chars| markov[chars[0..1].join] += [chars[2]] }
choices = []
likely_moves = markov.key?(history[-2,2]) ? markov[history[-2,2]] : history.chars
likely_moves.each { |move| choices += responses[move] }
end
puts choices.sample
λ€μκ³Ό κ°μ΄ μ€ν
markov.rb
λ΅λ³
보μμ μΈ λ΄, 루λΉ
μλ‘μ΄ κ²μ λμ κ²μ λλ€.
puts ['R','P','S'].sample
λ€μκ³Ό κ°μ΄ μ€ν
ruby conservative.rb
λ΅λ³
μ€ν μμ¦ ν¬-루λΉ
μ€ν¬λ₯, μ€ν
puts ['R','P','L','S'].sample
λ€μκ³Ό κ°μ΄ μ€ννμμμ€.
ruby starwarsfan.rb
λ΅λ³
λ°λ μ€ν΄ μ¨-루μ
λλ λ¨ νλμ κ·μΉμ κ°μ§κ³ μμ΅λλ€ : μλ‘μ΄ κ²μ΄ νμ μ’μ΅λλ€. μ€λλ μ‘° μΌ ν¬ λλ λΉμ μ΄ λΆλ₯΄λ κ²μ μ‘°μ΄μμμ€.
math.randomseed(os.time())
print(math.random() > 0.5 and "V" or "L")
λ€μκ³Ό κ°μ΄ μ€ννμμμ€.
lua legenwaitforitdary.lua
λ΅λ³
λ³΄λ§ λ΄ (μλ°)
κ·Έλ λͺ¨λ μ¬λμ΄ νμ κ°μ κ²μνκ³ κ·Έμ λ°λΌ κ³ννλ€κ³ κ°μ ν©λλ€. κ·Έλ μΌλ°μ μΌλ‘ κ΄κ³μμ λ°μλ₯Ό 골λΌλ λλ€.
public class BoringBot
{
public static void main(String[] args)
{
int Rock=0;
int Paper=0;
int Scissors=0;
int Lizard=0;
int Spock=0;
if (args.length == 0)
{
System.out.print("P");
return;
}
char[] oppPreviousPlays = args[1].toCharArray();
for (int j=0; j<oppPreviousPlays.length; j++) {
switch(oppPreviousPlays[j]){
case 'R': Rock++; break;
case 'P': Paper++; break;
case 'S': Scissors++; break;
case 'L': Lizard++; break;
case 'V': Spock++;
}
}
int Best = Math.max(Math.max(Lizard+Scissors-Spock-Paper,
Rock+Spock-Lizard-Scissors),
Math.max(Math.max(Paper+Lizard-Spock-Rock,
Paper+Spock-Rock-Scissors),
Rock+Scissors-Paper-Lizard));
if (Best== Lizard+Scissors-Spock-Paper){
System.out.print("R"); return;
} else if (Best== Rock+Spock-Lizard-Scissors){
System.out.print("P"); return;
} else if (Best== Paper+Lizard-Spock-Rock){
System.out.print("S"); return;
} else if(Best== Paper+Spock-Rock-Scissors){
System.out.print("L"); return;
} else {
System.out.print("V"); return;
}
}
}
λ΅λ³
IocainePowder, 루λΉ
RPS μ λ΅μ κΈ°λ°μΌλ‘ ν©λλ€ . λ΄μ Markov λ΄κ³Ό λμΌν μΆμΈ‘μ μ ννμ§λ§ μλλ°©μ΄ μ ννλ €λ νλͺ©μ μΆμΈ‘νλ€κ³ κ°μ νκ³ κ·Έμ λ°λΌ μ΄κΈΈ μμλ μμ§μμ μ νν©λλ€.
λ§ν¬ λ μ λ΅μ κΈ°λ³Έ μμ΄λμ΄λ₯Ό μμΈν μ μ©νμ§ μκ³ λ°©κΈ μ‘°μ νμ΅λλ€.
responses = {
'R' => ['P', 'V'],
'P' => ['S', 'L'],
'S' => ['R', 'V'],
'L' => ['S', 'R'],
'V' => ['P', 'L']
}
if ARGV.length == 0 || (history = ARGV[1]).length < 3
choices = ['R','P','S','L','V']
else
markov = Hash.new []
history.chars.each_cons(3) { |chars| markov[chars[0..1].join] += [chars[2]] }
choices = []
likely_moves = markov.key?(history[-2,2]) ? markov[history[-2,2]] : history.chars
likely_moves.each { |move| choices += responses[move] }
end
myChoice = choices.sample
theirChoice = responses[myChoice].sample
actualChoice = responses[theirChoice].sample
puts actualChoice
λ€μκ³Ό κ°μ΄ μ€ν
iocaine.rb