Skip to content

Instantly share code, notes, and snippets.

@tom-galvin
Created March 10, 2014 17:11
Show Gist options
  • Save tom-galvin/9469380 to your computer and use it in GitHub Desktop.
Save tom-galvin/9469380 to your computer and use it in GitHub Desktop.
DailyProgrammer Challenge #130 Solution
/*
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