Added Copyright stuff.

This commit is contained in:
Deathsbreed 2014-10-30 15:21:47 -05:00
parent c9be9f9ab1
commit fe0b52768d
2 changed files with 24 additions and 22 deletions

View File

@ -21,5 +21,5 @@ src/%.o: src/%.c
clean: clean:
$(RM) src/*.o $(RM) src/*.o
fullclean: clean cleanall: clean
$(RM) bin $(RM) bin

View File

@ -47,7 +47,9 @@ int main(int argc, char **argv) {
srand(time(NULL)); srand(time(NULL));
printf("Working...\n");
for(int i = 0; i < trials; i++) { for(int i = 0; i < trials; i++) {
if(i % 100000000 == 0) printf("Working...\n");
int r = rand() % 100 + 1; int r = rand() % 100 + 1;
if(r <= 50) heads++; if(r <= 50) heads++;
else tails++; else tails++;
@ -61,33 +63,33 @@ int main(int argc, char **argv) {
void printCopyright() { void printCopyright() {
printf("CoinToss %s Copyright (C) 2014 Nicolás A. Ortega\n\ printf("CoinToss %s Copyright (C) 2014 Nicolás A. Ortega\n\
This program comes with ABSOLUTELY NO WARRANTY; for details use `-w'.\n\ This program comes with ABSOLUTELY NO WARRANTY; for details use `-w'.\n\
This is free software, and you are welcome to redistribute it\n\ This is free software, and you are welcome to redistribute it\n\
under certain conditions; use `-c' for details.\n\n", version); under certain conditions; use `-c' for details.\n\n", version);
} }
void printAllCopyright() { void printAllCopyright() {
printf("CoinToss, a probability simulator.\n\ printf("CoinToss, a probability simulator.\n\
Copyright (C) 2014 Nicolás A. Ortega\n\n\ Copyright (C) 2014 Nicolás A. Ortega\n\n\
This program is free software: you can redistribute it and/or modify\n\ This program is free software: you can redistribute it and/or modify\n\
it under the terms of the GNU General Public License as published by\n\ it under the terms of the GNU General Public License as published by\n\
the Free Software Foundation, either version 3 of the License, or\n\ the Free Software Foundation, either version 3 of the License, or\n\
(at your option) any later version.\n\n\ (at your option) any later version.\n\n\
This program is distributed in the hope that it will be useful,\n\ This program is distributed in the hope that it will be useful,\n\
but WITHOUT ANY WARRANTY; without even the implied warranty of\n\ but WITHOUT ANY WARRANTY; without even the implied warranty of\n\
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\
GNU General Public License for more details.\n\n\ GNU General Public License for more details.\n\n\
You should have received a copy of the GNU General Public License\n\ You should have received a copy of the GNU General Public License\n\
along with this program. If not, see <http://www.gnu.org/licenses/>.\n"); along with this program. If not, see <http://www.gnu.org/licenses/>.\n");
} }
void printWarranty() { void printWarranty() {
printf(" THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\n\ printf(" THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\n\
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\n\ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\n\
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\n\ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\n\
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\n\ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\n\
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n\ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n\
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\n\ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\n\
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\n\ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\n\
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n"); ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n");
} }