Project in Rust Skill Tree

Building a Dice Game in Rust

Build a playable three-round Rust dice game with typed scoring categories, legal round transitions, and a complete scorecard that can be recalculated from recorded dice and choices.

ProjectRust

Introduction

Building a Dice Game in Rust is a practical project for learners who know Rust fundamentals and want to turn small functions into a playable terminal game. You will build a three-round match with five dice per round, three scoring categories, and a complete scorecard that can be checked by replaying its recorded choices.

Two Guided Labs take you from typed scoring rules to legal round transitions. One Challenge asks you to apply the same rules to a different match. Each lab starts with its own prepared project; you carry forward your knowledge rather than files from an earlier environment.

What You Will Learn

After completing this course, you will be able to:

  • represent scoring categories with an enum and calculate their scores with match;
  • score a sum, the highest pair, and a five-number straight, including valid zero scores;
  • accept one unused category per round while keeping the current dice after an invalid or repeated choice;
  • save each round's dice, category, and score in match.tsv, then replay that exact file to recompute the total;
  • exercise your rules with fixed dice and play a match with the prepared random roller and input interface.

Who This Course Is For

This course is for Rust learners ready to combine familiar language features into a small interactive program.

Prerequisites: Basic terminal use and Rust functions, arrays, enums, match, and Option. Rust for Beginners provides the relevant foundation. The second Guided Lab introduces struct, Vec, mutable methods with &mut self, Result, and slices as needed.

Learning environment: LabEx provides a browser-based Linux Terminal and a prepared Rust project. The input interface and random roller are supplied; you implement the scoring and scorecard behavior. Terminal prompts and program output remain in English.

Frequently Asked Questions

Do I need game-development experience?

No. The game has three short, explicit scoring rules. You do not need graphics, a game engine, or a winning strategy.

Does a zero score mean the turn failed?

No. A legal category choice can score zero and still complete the round. Invalid or already-used categories are rejected without rerolling the current dice.

How long should I allow?

The author estimates 110–150 minutes, including reading and ordinary mistakes. This estimate has not been validated through a beginner walkthrough.

Teacher

labby
Labby
Labby is the LabEx teacher.