Saturday, 7 November 2026
PastThree rungs, one idea. Solving rung 1 counts. Climb as far as you can.
Rock Paper Scissors
if/else + comparing words
Who wins this round
Write a function called round_winner
Rock beats scissors, scissors beats paper, and paper beats rock. You get the move of the first player and the move of the second player, each one of "rock", "paper" or "scissors". Return "first" if the first player wins, "second" if the second player wins, and "draw" if both played the same move.
Examples
| Input | Output |
|---|---|
| "rock", "scissors" | "first" |
| "rock", "paper" | "second" |
| "paper", "paper" | "draw" |
| "scissors", "paper" | "first" |
There are extra hidden tests, so make it work in general, not just for these.
Every round of the match
Write a function called round_results
Now two lists of moves are played against each other: the first move of each list is round one, the second move of each is round two, and so on. The two lists are always the same length. Return a list with the result of each round, using the same words as before. So ["rock", "paper"] against ["scissors", "paper"] gives ["first", "draw"]. Two empty lists give an empty list.
Examples
| Input | Output |
|---|---|
| ["rock", "paper"], ["scissors", "paper"] | ["first", "draw"] |
| [], [] | [] |
| ["rock"], ["paper"] | ["second"] |
| ["paper", "scissors", "rock"], ["rock", "paper", "paper"] | ["first", "first", "second"] |
There are extra hidden tests, so make it work in general, not just for these.
Who is ahead
Write a function called score_gap
Play the whole match and work out how far ahead the first player is. Return the number of rounds the first player won minus the number of rounds the second player won. Drawn rounds count for nobody. The answer is negative when the second player is ahead, and 0 when it is level. Two empty lists give 0.
Examples
| Input | Output |
|---|---|
| ["rock", "paper", "rock"], ["scissors", "rock", "paper"] | 1 |
| [], [] | 0 |
| ["rock"], ["paper"] | -1 |
| ["rock", "paper"], ["rock", "paper"] | 0 |
There are extra hidden tests, so make it work in general, not just for these.
Finish Rung 1 and today counts. Rungs 2 and 3 are there if you want to push further.