This is Test2.m in view mode; [Download] [Up]
// // Test2 // // This program tests the Random class by requesting // 1000 integers from 1 to 100. They are printed in // rows of 10. // // Version 1.0, 1991 May 30 // // Written by Gregor Purdy // gregor@oit.itd.umich.edu // // See the README and COPYING files included for // information and distribution and usage rights. // #import <stdio.h> #import "Random.h" int main(int argc, char *argv[]) { Random *roller; // Roller to use for this test int loop; // General loop variable int max = 1000; int count = 0; roller = [[Random alloc] init]; for (loop = 0 ; loop < max ; loop++) { printf("%5d", [roller rollDie:100]); count++; if (loop != (max - 1)) printf(", "); if (count == 10) { printf("\n"); count = 0; } } printf("\n"); return 0; } // // End of file. //
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.