0Pricing
Javascript for Kids · Lesson

A Lucky Number Game

Build a tiny game of chance.

A Lucky Game! 🍀

Let us build a tiny game of chance! 🎰

The computer picks a lucky number. Did you win? 🎉

The Lucky Number 🎲

First, the computer picks a secret lucky number from 1 to 6. 🍀

let lucky = Math.floor(Math.random() * 6) + 1;
console.log("Lucky number chosen!");

All lessons in this course

  1. Making Random Numbers
  2. Rolling a Dice
  3. Picking a Random Item
  4. A Lucky Number Game
← Back to Javascript for Kids