algorithm-archive
algorithm-archive copied to clipboard
Added Monte Carlo Implementation in TI-83 BASIC
Example code is also a visualization demo
Coding with ethanol
Ahh, that explains why you wrote Monte Carlo in TI-BASIC, of all languages.
lol thats my moniker i usually put it all as one word, e.g. codingwithethanol but yes i also coded it because i was bored and somebody already did bubblesort in ti-basic
To anyone who wants to pick this PR up: I remember testing the code and it worked just fine. The changes I requested were merely for compatibility with the TI-82. If you want to leave the code sample as strictly TI-83 code, it's ready to merge.
This PR is almost ready to go. If anyone knows anything about TI83 and can change the few lines necessary (even in a separate PR), we can probably merge this.
The implementation also needs to be added to the text
Is this the code we want in the end?
"MONTE PROGRAMMED BY CODING WITH ETHANOL AND TOMMYTORTY10
ClrHome
Prompt M
0->C
0->I
StoreGDB 1
ClrDraw
AxesOff
CoordOff
GridOff
LabelOff
0->Xmin:1->Xmax
0->Ymin:1->Ymax
Circle(0,0,1)
For(I,0,M,1)
rand->X
rand->Y
Pt-On(X,Y)
If ((X*X+Y*Y)<1):Then
C+1->C
End
End
ClrHome
(C/M)*4->E
Text(28,43,E)
Pause
RecallGDB 1
ClrHome
AxesOn
CoordOn
GridOn
LabelOn
@theinventor13 if you are ready to add your code to the relevant .md
file, I am ready to merge this PR, since Butt4cak3 judged it was nice enough. :slightly_smiling_face:
Otherwise, I think we can do it ourselves.