algorithm-archive icon indicating copy to clipboard operation
algorithm-archive copied to clipboard

Added Monte Carlo Implementation in TI-83 BASIC

Open theinventor13 opened this issue 6 years ago • 6 comments

Example code is also a visualization demo

theinventor13 avatar Dec 04 '18 21:12 theinventor13

Coding with ethanol

Ahh, that explains why you wrote Monte Carlo in TI-BASIC, of all languages.

nic-hartley avatar Jan 03 '19 01:01 nic-hartley

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

theinventor13 avatar Jan 03 '19 06:01 theinventor13

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.

Butt4cak3 avatar Nov 27 '19 21:11 Butt4cak3

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

leios avatar May 20 '20 22:05 leios

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

leios avatar May 20 '20 23:05 leios

@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.

Amaras avatar Dec 08 '21 17:12 Amaras