Skip to content

Command-line utility computing a probability of dice results.

Notifications You must be signed in to change notification settings

roman-zaharenkov/dice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task:

Write a command-line utility computing a probability of getting a value M when throwing N dice.

Functional requirements:

  • The program must take two arguments: the number of dice N and the value M.
  • The program must output a single floating-point value: the probability of getting M when throwing N dice once.
  • The program must exit correctly when given meaningless input, such as negative number of dice etc.

Performance requirements:

  • A mean running time over 10 runs with 100 dice must not exceed 2 seconds, with a standard deviation not more than 50 milliseconds.
  • A mean running time over 10 runs with 200 dice must not exceed 3.5 seconds, with a standard deviation not more than 75 milliseconds.
  • A mean running time over 10 runs with 300 dice must not exceed 7 seconds, with a standard deviation not more than 100 milliseconds.

Implementation requirements:

  • Programming language: Ruby.
  • Comments are required.
  • Unit testing is required.

About

Command-line utility computing a probability of dice results.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages