Kashish Dugar

Rebuilding the guessing game from memory

I had 20 minutes to rebuild my guessing game with the book closed. I remembered the secret number from 1 to 100, the loop, too low and too high, “You win!” and break. Then I opened the book and made a list of everything I couldn’t remember.

My couldn't remember list

What each part means

My errors

My prediction page

From today I write my prediction on paper before every run.

My prediction page

Rust Chapter 3.1: Variables and Mutability

I also started a Python vs Rust table: print is println! and while is like loop.

Python vs Rust

Petzold: Bit by Bit by Bit

I always write the place values from the right first. 1100 = 12 and 10101 = 21.

A bit is one yes-or-no answer: a 0 or a 1. To guess which of 4 smoothie flavours someone picked, you only need 2 yes-or-no questions. 2 bits give 4 messages, and everyone must agree on the code. A whistle means nothing unless me and my coach agreed on what it is.

My Petzold notes