/* * Board: Arduino Uno * Target: Caveman Diorama * Author: Clive "Max" Maxfield (max@clivemaxfield.com) * License: The MIT License (See full license at the bottom of this file) * * Notes: Testing the Arduino's random number generation */ #define MAX_COIN_TOSS 1001 // Used to generate random number void setup() { int x; int y; Serial.begin(9600); delay(10000); // Get ready for (int i = 0; i < 10; i++) { Serial.println("Start"); } for (int i = 0; i < 1000; i++) { x = random(0, MAX_COIN_TOSS); y = random(0, MAX_COIN_TOSS); Serial.print(x); Serial.print(","); Serial.println(y); } for (int i = 0; i < 10; i++) { Serial.println("End"); } } void loop() { while(1); } /* * Copyright (c) 2016 Clive "Max" Maxfield * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHOR(S) OR COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */