Last active
September 30, 2021 10:16
-
-
Save nfitzen/49275919f1a3b56aa00251f4f29b65b8 to your computer and use it in GitHub Desktop.
A simple means to seed a TI-84 randomizer based on the date and time. Written in SourceCoder3 format: <https://www.cemetech.net/sc/>.
This file contains 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
"SPDX-License-Identifier: CC0-1.0 | |
"SPDX-FileCopyrightText: 2021 Nathaniel Fitzenrider <HTTPS://GITHUB.COM/NFITZEN> | |
Input "UTC Offset:",O | |
O:prgmTIUTIME:Ans->T | |
Input "Arbitrary const:",K | |
If K>=|-1 and K<=1:Then | |
T->R | |
Else | |
1|E10*fPart(TK/1|E10->R | |
End | |
R->rand |
This file contains 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
If 0:Then | |
"SPDX-License-Identifier: CC0-1.0 | |
"SPDX-FileCopyrightText: 2021 Nathaniel Fitzenrider <HTTPS://GITHUB.COM/NFITZEN> | |
End | |
Ans->O | |
getDate->DATE | |
getTime->TIME | |
(|LDATE(1)-1997)*365*24*3600->T | |
"28+remainder(X+iPart(X/8),2)+remainder(2,X)+2iPart(1/X->{Y0} | |
0->D | |
For(M,1,|LDATE(2)-1 | |
D+{Y0}(M->D | |
End | |
For(Y,2000,|LDATE(1),4 | |
If (remainder(Y,100) or not(remainder(Y,400))) and ((Y=|LDATE(1) and |LDATE(2)>2) or Y<|LDATE(1 | |
D+1->D | |
End | |
T+(D+|LDATE(3)-1)*24*3600->T | |
T+|LTIME(1)*3600+|LTIME(2)*60+|LTIME(3->T | |
T-3600O->T | |
T |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment