Happy Pi day

Post Reply
User avatar
tristanbgilb
Posts: 1048
Joined: Tue Sep 01, 2020 9:20 pm
Contact:

Re: Happy Pi day

Post by tristanbgilb »

dorankj wrote: Wed Apr 19, 2023 8:05 amI
YES I, i is I

an Irie I
and ALL is with us All
God Bless America
Image

Image <=NUCLEAR BUTTONImage

Image

KFAC-LP 105.5 FM Twisp WA
dorankj
Posts: 838
Joined: Thu Sep 02, 2021 1:08 pm
Contact:

Re: Happy Pi day

Post by dorankj »

I
User avatar
mister_coffee
Posts: 1388
Joined: Thu Jul 16, 2020 7:35 pm
Location: Winthrop, WA
Contact:

Re: Happy Pi day

Post by mister_coffee »

Calculate pi to however many decimal places you'd like, if you're patient:

https://github.com/davidbonn/PythonIQ/b ... calc_pi.py

From the Medium article:

https://medium.com/pythoniq/progress-ba ... 77838077a9
:arrow: David Bonn :idea:
User avatar
tristanbgilb
Posts: 1048
Joined: Tue Sep 01, 2020 9:20 pm
Contact:

Re: Happy Pi day

Post by tristanbgilb »

I wrote this program for the Timex Sinclair 1000 that creates a circlular image using only the basic math functions of +,-,*,/.... No square roots or pies at all. It is written specifically for the ZX Compiler to convert into machine code for a faster running program. The end result is a program written in Hexidecimal which the computer can read more quickly than the original BASIC program.
tristanbgilb wrote: Sun Jan 29, 2023 8:59 pm Image

This Code creates the circle pixelated image that you are seeing at normal speed.

Code: Select all

     5 REM LETH=34
    10 REM LETK=22
    15 REM PLOTH,K
    20 REM LETR=21
    25 REM LETR=R-1
    30 REM IFR=0GOTO315
    35 REM LETT=R
    40 REM LETU=R
   125 REM LETT=R
   130 REM LETX=T
   135 REM LETY=0
   140 REM LETY=Y+1
   145 REM IFY=RGOTO220
   150 REM LETG=R*R
   155 REM LETJ=Y*Y
   160 REM LETW=G-J
   165 REM LETT=X
   170 REM LETX=W/T
   175 REM LETA=X+H
   180 REM LETB=H-X
   185 REM LETC=Y+K
   190 REM LETD=K-Y
   195 REM PLOTA,C
   200 REM PLOTB,C
   205 REM PLOTA,D
   210 REM PLOTB,D
   215 REM GOTO140
   220 REM LETY=R
   225 REM LETX=0
   230 REM LETX=X+1
   235 REM IFX=RGOTO310
   240 REM LETM=R*R
   245 REM LETN=X*X
   250 REM LETQ=M-N
   255 REM LETU=Y
   260 REM LETY=Q/U
   265 REM LETA=X+H
   270 REM LETB=H-X
   275 REM LETC=K-Y
   280 REM LETD=Y+K
   285 REM PLOTB,C
   290 REM PLOTA,C
   295 REM PLOTB,D
   300 REM PLOTA,D
   305 REM GOTO230
   310 REM GOTO25
   315 REM LETR+21
   335 REM LETR=R-1
   340 REM IFR=0GOTO625
   345 REM LETT=R
   350 REM LETU=R
   435 REM LETT=R
   440 REM LETX=T
   445 REM LETY=0
   450 REM LETY=Y+1
   455 REM IFY=RGOTO530
   460 REM LETG=R*R
   465 REM LETJ=Y*Y
   470 REM LETW=G-J
   475 REM LETT=X
   480 REM LETX=W/T
   485 REM LETA=X+H
   490 REM LETB=H-X
   495 REM LETC=Y+K
   500 REM LETD=K-Y
   505 REM UNPLOTA,C
   510 REM UNPLOTB,C
   515 REM UNPLOTA,D
   520 REM UNPLOTB,D
   525 REM GOTO450
   530 REM LETY=R
   535 REM LETX=0
   540 REM LETX=X+1
   545 REM IFX=RGOTO620
   550 REM LETM=R*R
   555 REM LETN=X*X
   560 REM LETQ=M-N
   565 REM LETU=Y
   570 REM LETY=Q/U
   575 REM LETA=X+H
   580 REM LETB=H-X
   585 REM LETC=K-Y
   590 REM LETD=Y+K
   595 REM UNPLOTB,C
   600 REM UNPLOTA,C
   605 REM UNPLOTB,D
   610 REM UNPLOTA,D
   615 REM GOTO540
   620 REM GOTO335
   625 REM GOTO5
Image

Image <=NUCLEAR BUTTONImage

Image

KFAC-LP 105.5 FM Twisp WA
Jingles
Posts: 349
Joined: Wed Aug 03, 2022 3:48 pm
Contact:

Happy Pi day

Post by Jingles »

No wonder kids are having trouble with math.
Teachers saying
Pie are squared when everyone knows pies are round
Even teachers are confused
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 0 guests