I need help with writing an interactive program that simulates the roll of two die. It must use functions and output something that looks like dice with the dots as numbers on them. Also make a function to output the dice and allow the user to roll until they choose to quit. and i need them to print side by side... please im new to this and I'm struggling with imputing the second die...
All your roll() function needs to return is : return (rand() % 6) + 1;
Instead of using goto (which is evil!) why not:
1 2 3 4 5
(while ch != 'q')
{
// process rolls...
// prompt again for r or q
}
As for getting the dice to display side by side, you need to rethink your output methods. Think about storing each "line" of ouput (top to bottom) in an array, to make them easier to line up horizontally like perhaps: