Skip to content

Not so random randint #10

@TamaMcGlinn

Description

@TamaMcGlinn

I tried using randint to make a number guessing game, but it suspiciously always selected 1. The problem is the lack of seed:

  static random_device r;
  static default_random_engine ran(r());

Is what you need.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions