Skip to content

Instantly share code, notes, and snippets.

@nfitzen
Last active September 30, 2021 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nfitzen/49275919f1a3b56aa00251f4f29b65b8 to your computer and use it in GitHub Desktop.
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/>.
"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
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