Exam Reference Sheet
On exam day you get a one-page reference sheet of pseudocode. You have written the C# version of all of it for a year — the only new skill is reading their exact notation. Here is the full sheet, side by side with what it looks like in our world.
Displaying and assignment
| Reference sheet | What it means | Our C# |
|---|---|---|
DISPLAY(expression) | Output the value | Debug.Log(expression) |
a ← expression | Assign (the arrow, not =) | a = expression; |
RANDOM(a, b) | A random integer from a to b, inclusive | Random.Range(a, b + 1) (Unity's is exclusive at the top for ints) |
Arithmetic and logic
| Reference sheet | What it means | Our C# |
|---|---|---|
a MOD b | Remainder after dividing | a % b |
a / b | The value of a divided by b — real division, even when both are integers (17 / 5 is 3.4) | (double)a / b — C# truncates when both are ints, so cast one side |
NOT, AND, OR | Boolean operators | !, &&, || |
=, ≠, >, <, ≥, ≤ | Comparisons | ==, !=, >, <, >=, <= |
Selection and iteration
IF (condition)
{
<block of statements>
}
ELSE
{
<block of statements>
}
REPEAT n TIMES
{
<block of statements>
}
REPEAT UNTIL (condition)
{
<block of statements>
}
FOR EACH item IN aList
{
<block of statements>
}Note what the sheet does NOT have: for (int i = 0; i < n; i++)— the exam counts loops with REPEAT n TIMES and walks lists with FOR EACH. A counted loop becomes "REPEAT n TIMES" plus your own counter if you need the index.
Lists (the exam's biggest topic)
| Reference sheet | What it means | Our C# |
|---|---|---|
aList ← [value1, value2, value3] | Create a list with those values | new List<int> { value1, value2, value3 } |
aList[i] | The value at position i — starts at 1, not 0 | aList[i - 1] (C# indexes from 0!) |
INSERT(aList, i, value) | Put value at position i, shifting the rest | aList.Insert(i - 1, value) |
APPEND(aList, value) | Add value at the end | aList.Add(value) |
REMOVE(aList, i) | Remove the value at position i | aList.RemoveAt(i - 1) |
LENGTH(aList) | How many values | aList.Count |
Procedures
PROCEDURE name (parameter1, parameter2)
{
<block of statements>
RETURN(expression)
}A procedure is our method; a parameter is the variable it receives; RETURN hands a value back to whoever called it. You built these all year: ChangeHealth(int amount),ChangeCoins(int amount), Shuffle(List<Card_data> deck).
Reading-trap drills
Drill 1: Write your card-jam Shuffle in exam pseudocode. Then hand it to a neighbor and have THEM trace what it displays on a 5-card deck.
Drill 2: Convert these exam lines to C#:x ← RANDOM(1, 6)
REMOVE(deck, 1)
FOR EACH c IN deck. The first one surprises people.
Drill 3: Trace REPEAT UNTIL (LENGTH(aList) = 1)starting with a 4-item list where each pass removes item 2. How many repetitions? Count them, do not estimate.