Skip to content

A program that simulates rolling two six-sided dice 1000 times, and prints a table of the empirical distribution.

Notifications You must be signed in to change notification settings

SResor/diceSimulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

diceSimulator

Master File for the diceSimulator Assembly Language program. This program simulates rolling two six-sided dice. It then keeps track of how many of each number (2-12) are rolled, and after 1000 iterations it prints the empirical distribution.

This program was written first as practice for, and then modified for submission as, the midterm for CSCI 212: Machine Org/Assembly Language.

diceSimulator Files:

  • Main.s: Initializes the array and houses loops that calls several subfunctions (described below)
  • incArray.s: Increments the necessary array index based on the number passed to it
  • initArray.s: Sets the value of each index of the array to 0.
  • modulo.s: Performs a modulo of two arguments passed to it and returns the result.
  • printTable.s: Prints a table showing the empirical distribution of the dice rolls.
  • rollDie.s: Generates a random number between 1 and 6 and returns it.

The output of this program, as submitted for the exam, can be seen below: Midterm Output

About

A program that simulates rolling two six-sided dice 1000 times, and prints a table of the empirical distribution.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published