Created
March 10, 2014 17:11
-
-
Save tom-galvin/9469380 to your computer and use it in GitHub Desktop.
DailyProgrammer Challenge #130 Solution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
reddit.com/r/DailyProgrammer | |
Solution to Challenge #130: Roll the Dies | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
int main(int argc, char **argv) | |
{ | |
int rolls, faces; | |
srand(time(NULL)); | |
while(scanf("%dd%d", &rolls, &faces)) | |
{ | |
while(rolls--) printf("%d ", rand() % faces + 1); | |
puts(""); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment