Description:
Lesson 021 of Programming with Wantzel, a free course for beginners: learn to program by building small programs, compiled with the Wantzel compiler from the very first lesson.
What you learned:
- a mod b: the remainder
- import rand;
- rand.below(n): 0 to n - 1
- rand.below(6) + 1 is a die
- rand.below(2): a coin
Chapters
0:00 Intro
0:19 Computers cannot flip coins
0:39 Today
0:49 mod = what is left over
1:07 Write mod.wz
1:26 mod 6 always gives 0 to 5
1:39 When the compiler says no
1:56 Ask the system for luck
2:13 Write die.wz
2:47 Why not use mod yourself?
3:05 Write pair.wz
3:47 Write game.wz
4:23 Write coin.wz
4:59 What you learned
5:37 Your turn
Download the free compiler: https://wantzel.com/download/
Getting started: https://wantzel.com/docs/start/
Docs: https://wantzel.com
All lessons, in order: https://www.youtube.com/playlist?list=PLHlaLuY3uHNA
Previous lesson: https://www.youtube.com/watch?v=25euLYYeyNE
Next lesson: https://www.youtube.com/watch?v=2HvN_5VX420
Books, Expert Days and more: https://florisknol.com
Share this link via
Or copy link























