Tools for the Job: a Farkle worksheet (DRAFT for Jeremy)
Not graded. Nothing you write here is collected or scored. You do not build the whole system. We built the tools; you play with them, predict, compare, change one small thing and tell us what surprised you. Use a nickname, never your real name.
The big idea: understand your problem before you pick a tool. A fast script is often the smartest answer. A bigger, smarter, slower tool is sometimes worth it. Your job this week is to learn to tell which situation you are in.
Before you run anything: predict (5 min)
Write a guess for each. You will check them. Guessing first is the point.
- A game where every roll is forced and you never choose anything (think: roll, add, repeat). Will a smarter player win more often than a random one? Why or why not?
- In Farkle, which will win more often against the rule-book bot R5: bank at 300, bank at 1,000, or a bot that learned from practice turns?
- A language model chooses Farkle moves one at a time. Compared with a plain script, how much slower will it be: 2x, 100x, 5,000x?
Part A: take the tour (10 min)
cd student_kit
py -3 tool_tour.py
It plays each tool against R5 and prints a table. Copy it here.
| Tool | Games per second | Win rate vs R5 | Forced moves (%) |
|---|---|---|---|
| R5 (rule book) | |||
| bank at 300 | |||
| bank at 1,000 | |||
| learned bot |
- R5 is playing itself in the first row, so in the long run it should win about half the time. In a short run it will not be exactly 50%. How far from 50% did yours land, and why is that not a bug?
- Which tool was fastest? Which won most? Were they the same tool?
- Forced moves are moves with only one legal choice, so there is nothing to decide. What share of Farkle moves are forced? What does that say about how much "thinking" the game needs?
Part B: fill in the blank (20 min)
Open my_bot.py. There is one function:
def my_rule(state):
# state has: turn_score, dice_remaining, total_score, target_score, opponent_score
# return "roll" or "bank"
return "bank" if state["turn_score"] >= 300 else "roll"
- Finish the sentence: "I bank when ..."
- Write it as code. Run
py -3 compare.py. Your rule plays R5 on 100 games (both seats). - Result: wins __ losses ; games per second __
- Change one thing (a number, or add a second condition, such as dice left or how far behind you are). Run again. What changed?
- Run it again with a different seed:
py -3 compare.py --seed-start 40100. Same matchup, different seed, different answer. How different? What does that tell you about a single run?
If you want more: use opponent_score; or find a spot where your rule and R5 disagree and decide who is right.
Part C: read the recorded data (10 min)
We also ran two language models (on a lab computer, because they need special hardware you do not have) and the learned bot against R5. The numbers are in recorded_llm_practice.json and tool_tour.py prints them. They are practice runs with small samples and a plain prompt, not a verdict on language models.
| Tool | Wins of 20 | Model calls | Time |
|---|---|---|---|
| Learned bot | |||
| qwen3.5:9b (local model) | |||
| gemma3:12b (local model) |
- Both models lost every game. Does that prove a language model cannot play Farkle? What would you change before you believed an answer either way?
- A model call took about a quarter of a second. A script move takes microseconds. When is that difference a problem? When does it not matter?
Part D: choose the tool (15 min)
For each problem, pick one: plain script, learned model, or large language model. Say why in a sentence. There is no single right answer; reasons matter.
| Problem | Your pick | Why |
|---|---|---|
| Add up the dice in a forced-move game | ||
| Choose bank or roll in Farkle | ||
| Play checkers well | ||
| Decide whether an opponent is bluffing in a dice game | ||
| Summarize a long, messy document |
Then answer: When is it right to buy the bigger model and run it longer? And when is it wasteful?
Part E: repeat what we did, then ask
The local exercise recipe (tool tour and comparison) is in README_START.txt. Pick one thing you would try next and write it down:
Questions I have:
What surprised me: