Skip to content

[USER STORY] Generate a random, length 4, secret code for Mastermind #44

@jody

Description

@jody

User Story

As a player, I want the game to randomly generate a length 4 secret code so that each round is a fresh challenge.

Acceptance Criteria

  • Code must be exactly 4 symbols, chosen from a specified symbol set (e.g., 0-9).
  • Symbols may be repeated.
  • The code is hidden from the player but accessible for testing.

Details

  • Consider creating a method that returns a String (e.g., "1947", "#@$#").
  • Use a built-in random number generator to help create novel codes.
  • Write JUnit tests that confirm:
    • the code is exactly 4 symbols long.
    • all characters are symbols from the specified symbol set.
    • the same code is not generated more than twice in a sample size of 100.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GamesAssociated with Games project

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions