0Pricing
Javascript for Kids · Lesson

First to Twenty

Build the game.

First to Twenty Wins! 🎯

Time to build a real game: First to Twenty! 🎯

Players take turns rolling. The first to reach 20 points wins! 🏆

console.log('First to 20 wins! 🎯')
console.log('Keep rolling! 🎲')

The Goal 🏁

Let's set the goal to 20. We keep rolling until our score reaches it! 🏁

We store the goal in a box so it's easy to change later. 📦

let goal = 20
console.log('Goal: reach ' + goal + ' points! 🎯')

All lessons in this course

  1. Rolling a Die
  2. Two Dice
  3. Tracking Dice Points
  4. First to Twenty
← Back to Javascript for Kids