Caveman mad. Other caveman take stick but stick was for me. Caveman fight!
Description
Caveman need sharp stick to stab other caveman. Other caveman also try to stab with sharp stick. Caveman can sharpen stick, poke with stick, or block poky sticks.
If caveman poke other caveman with sharp stick, other caveman run away and me victory. But if other caveman smartly blocking when me poking, nothing happen except my stick become blunt and me need to sharpen again.
Caveman lazy. Also, caveman dumb. Caveman no know what to do, so caveman need fancy techno computer program to tell caveman what to do.
Input
Your program's input will be a history of the events that have happened, where S
stands for sharpen (i.e. the caveman sharpened his stick), P
stands for poke, and B
stands for block. The input will be a history of both sides (you and the opponent), so your and the opponent's moves will be separated with a comma (,
).
Example input:
SPB,SBB
This means that the player sharpened his/her stick, then poked, then blocked, and the opponent sharpened, then blocked, then blocked again.
You will receive no input on turn 1.
Output
The output is very similar to the input (because the caveman is not very smart). Your program should output S
to sharpen, P
for poke, and B
for block. Only the first character of output will be taken into account, and any other input will be treated as a B
(block) command.
S
: sharpenWhen sharpening, the caveman's stick's sharpness goes up by 1 and the stick gets 1 extra poke. Each poke reduces the stick's sharpness by 1, and if the stick's sharpness is 0, it's too dull to poke with. Sharpness starts at 0. If sharpness gets to 5, the stick is a sword! (See below.)
If the opponent pokes while you are sharpening (and they have a sharpness > 0), the opponent wins!
P
: pokeWhen poking, the caveman's stick's sharpness goes down by 1 and you poke your opponent! If your opponent is sharpening, you win! If the opponent is poking, your stick hits your opponent's stick and they both get duller (by 1 "sharpness unit"). If the opponent is blocking, nothing happens except that your stick becomes duller.
If you poke when your stick's sharpness is 5 or greater, your stick becomes a sword and you always win! (Unless your opponent also has a sword and also chose
P
; in that case, they both become duller, and may revert to sticks if their sharpness falls below 5.)You cannot poke with a sharpness of 0. If you do, nothing will happen.
B
: blockWhen you block, nothing happens when your opponent pokes. If your opponent is not poking, block does nothing.
Blocking does not protect against a sword, even if you also have one!
Rules and constraints
Additional rules are:
- Your program can read and write files in its own folder (no stealing!) if you want to save data, but you can't access anything outside of it (and cavemen don't have internet connection out in the wilderness).
- Important note on files: If you save files, remember to save them in the directory
players/YourBotsName/somefile.foo
! The current working directory for your program will not be your program's!
- Important note on files: If you save files, remember to save them in the directory
- Cavemen are fair: One program can not have code specific for another program, and programs can not help each other. (You may have multiple programs, but they can't interact with each other in any way.)
- The caveman judge is not patient. If the cavemen take more than 100 turns each to decide a winner, the judge gets bored and both cavemen lose.
If your program breaks a rule or doesn't follow the specification, the program is disqualified, removed from playerlist.txt
, and all duels restart from the beginning. If your program is disqualified, the caveman leader (me!) will comment on your program's post and explain why. If you aren't breaking any rules, your program will be added to the leaderboard. (If your program is not on the leaderboard, there is no explanatory comment on your post, and you posted your program before the "Last updated" time below, tell the caveman leader! Maybe he forgot it.)
In your post, please include:
- A name.
- A shell command to run your program (ex.
java MyBot.java
,ruby MyBot.rb
,python3 MyBot.py
, etc.).- Note: input will be appended to this as a command line argument.
- The cavemen use Ubuntu 14.04, so make sure your code works (freely) on it.
- A version number, if your code works differently on different versions of your chosen language.
- Your code (obviously).
- How to compile the code, if necessary.
Controller code / testing, example bot
The caveman leader wrote the control code in C++, and posted it on a Github repo. You can run and test your program there.
A very, very simple program (1 line!) is also posted in the answers below.
Scoring and leaderboard
Scoring is easy. Whichever caveman wins gets a point. The caveman with the most points after 3 duels against every other caveman becomes the new caveman leader!
150 Watson
147 SpeculativeSylwester
146 Gruntt
141 BashMagnon
126 ChargerMan
125 PrisonRules
124 ViceLeader
122 MultiMarkov
122 CaveDoctor
120 RegExMan
120 Hodor
117 FancyTechnoAlgorithm
116 Semipatient
113 Watcher
108 BobCaves
105 MinimaxMan
104 Oracle
102 MaybeMarkov
97 Nash
95 Sicillian
95 Feint
95 Basilisk
94 SharpMan
93 Darwin
91 Nigel
91 JavaMan
88 Entertainer
88 CarefulBot
85 CaveMonkey
84 SSBBP
82 SirPokealot
79 MasterPoker
77 Unpredictable
76 IllogicalCaveman
75 SharpenBlockPoke
75 HuddleWolfWithStick
72 WoodenShield
68 PokeBackBot
68 PatientBlacksmith
66 PatientWolf
58 MonteCarloMan
58 BlindFury
56 BinaryCaveman
55 PokeBot
55 CavekidBlocks
53 Swordmaster
53 Blocker
52 NakedEarlyNerd
52 ModestCaveman
50 LatePokeBot
40 Trickster
39 SwordLover
38 ForeignCaveman
36 Swordsmith *
28 Touche
27 WantASword
27 FoolMeOnce
24 PeriodicalCavemanCicada
11 Aichmophobic
(this leaderboard was auto-magically generated)
Players marked with a *
threw some kind of error or exception at some point; these players also have a comment on their posts.
Players who could not be included in the tests for any reason (these players will have a comment on their posts explaining the problem): Monkey
, Elephant
, FacileFibonacci
, StudiousSylwester
.
Last updated: Aug 3 00:15 (UTC).