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
| #include <stdlib.h> | |
| #include <time.h> | |
| void initrand() { | |
| srand((unsigned) time(NULL)); | |
| rand(); | |
| } | |
| int rangerand(int max, int min) { | |
| if(max < min) max = min; |
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
| #define XOR(a,b) ((!a&&b)||(a&&!b)) |
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
| function locationfromzone($lx, $ly) { | |
| $gSAZones = array( | |
| array("The Big Ear", array(-410.00,1403.30,-3.00,-137.90,1681.20,200.00)), | |
| array("Aldea Malvada", array(-1372.10,2498.50,0.00,-1277.50,2615.30,200.00)), | |
| array("Angel Pine", array(-2324.90,-2584.20,-6.10,-1964.20,-2212.10,200.00)), | |
| array("Arco del Oeste", array(-901.10,2221.80,0.00,-592.00,2571.90,200.00)), | |
| array("Avispa Country Club", array(-2646.40,-355.40,0.00,-2270.00,-222.50,200.00)), | |
| array("Avispa Country Club", array(-2831.80,-430.20,-6.10,-2646.40,-222.50,200.00)), | |
| array("Avispa Country Club", array(-2361.50,-417.10,0.00,-2270.00,-355.40,200.00)), | |
| array("Avispa Country Club", array(-2667.80,-302.10,-28.80,-2646.40,-262.30,71.10)), |
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
| // Written by Oliver Booth | |
| // Based on an XKCD comic | |
| // http://xkcd.com/149/ | |
| #include <stdio.h> | |
| #include <stdbool.h> | |
| #include <unistd.h> | |
| int main() { | |
| return printf(getuid() ? "What? Make it yourself.\n" : "Okay.\n"); |
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
| dow(y, m d) { | |
| t = { 0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4 }; | |
| y -= m < 3; | |
| return (y + y / 4 - y / 100 + y / 400 + t[m - 1] + d) % 7; | |
| } |
NewerOlder