* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: CWick Contest #4: The Tau Problem  (Read 1051 times)

0 Members and 1 Guest are viewing this topic.

Offline Juju

  • aka Yuki Kagayaki aka J̵̭͕͇ù̞̭̝̯̦j̴̭̙̗͖͡ù͏͓̲̕
  • CodeWalrus Staff
  • Super User
  • Server Maintenance
  • Moderator
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Inside a walrus
  • Posts: 2836
  • Post Rating Ratio: +19/-1
  • Couch potato
    • jul.savard
    • juju2143
    • @juju2143
    • juju2143
    • @julosoft
    • juju-kun
    • /u/juju2143
    • juju2143
    • View Profile
    • Juju's shed
  • Gender: Female
  • WalriiPoints: 99999
CWick Contest #4: The Tau Problem
« on: February 28, 2017, 05:03:02 am »
Wait what? It's back? Well, then. Today I ask you the 1000 first digits of tau. I think @JWinslow23 will love this one. So if you remember how it's done, I ask you a program that have this output exactly (or more):

Code: [Select]
6.283185307179586476925286766559005768394338798750211641949889184615632812572417997256069650684234135964296173026564613294187689219101164463450718816256962234900568205403877042211119289245897909860763928857621951331866892256951296467573566330542403818291297133846920697220908653296426787214520498282547449174013212631176349763041841925658508183430728735785180720022661061097640933042768293903883023218866114540731519183906184372234763865223586210237096148924759925499134703771505449782455876366023898259667346724881313286172042789892790449474381404359721887405541078434352586353504769349636935338810264001136254290527121655571542685515579218347274357442936881802449906860293099170742101584559378517847084039912224258043921728068836319627259549542619921037414422699999996745956099902119463465632192637190048918910693816605285044616506689370070523862376342020006275677505773175066416762841234355338294607196506980857510937462319125727764707575187503915563715561064342453613226003855753222391818432840398
You're allowed mostly everything, a calc (scrolling or output to a Str variable might be needed), a PC, a Google Home that speaks the output, whatever. This is also a code golf contest: smaller is better, but it will also be judged on how original the method to produce or to show the output is, be it an algorithm, compression or whatever, and also how fast it is. You need not to have that output exactly, variations are allowed, as long as it shows more or less these digits. Standard code golf pitfalls from Stack Overflow applies.

Send the sources of your entries to contest@codewalr.us. Contest ends Monday March 13th 23:59:59 EST. (Two weeks this time, because it's a big one.)

Note that the schedule is now whenever I feel like. Feel free to send ideas for future contests like this.
« Last Edit: February 28, 2017, 05:09:46 am by Juju »


  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????:trollface:???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

Offline gameblabla

  • Super User
  • Join Date: May 2015
  • Location:
  • Posts: 647
  • Post Rating Ratio: +11/-6
  • TI-nspire porter
    • View Profile
Re: CWick Contest #4: The Tau Problem
« Reply #1 on: February 28, 2017, 06:53:09 am »
Tau on the Colecovision :
1k of RAM just isn't enough for Tau...



I will send you the binaries and the sauce.
  • Calculators owned: TI Nspire CX, TI-89

Offline Juju

  • aka Yuki Kagayaki aka J̵̭͕͇ù̞̭̝̯̦j̴̭̙̗͖͡ù͏͓̲̕
  • CodeWalrus Staff
  • Super User
  • Server Maintenance
  • Moderator
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Inside a walrus
  • Posts: 2836
  • Post Rating Ratio: +19/-1
  • Couch potato
    • jul.savard
    • juju2143
    • @juju2143
    • juju2143
    • @julosoft
    • juju-kun
    • /u/juju2143
    • juju2143
    • View Profile
    • Juju's shed
  • Gender: Female
  • WalriiPoints: 99999
Re: CWick Contest #4: The Tau Problem
« Reply #2 on: February 28, 2017, 07:14:42 am »
Oooh, that nice. On that note, 1000 digits is not a hard limit if the system you're coding for don't allow for it, although there's algorithms that lets you calculate tau digit by digit, you might get around by throwing away the digit once it's displayed on screen.
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????:trollface:???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

Offline Unicorn

  • ??? ??? ??? ??? ???
  • Super User
  • CW Contest II - 2nd place
  • *
  • Join Date: Jan 2015
  • Location: ??? ??? ??? ??? ???
  • Posts: 2773
  • Post Rating Ratio: +5/-2
  • make :PICKACHUP: a thing!
    • Unicorn808
    • 114/11432
    • View Profile
    • ??? ??? ??? ??? ???
  • Gender: Male
Re: CWick Contest #4: The Tau Problem
« Reply #3 on: February 28, 2017, 07:41:43 am »
This reminds me... Did i ever get my Hello World walrii points? :P

Oh yes, and now i have an interesting idea.. not sure if i could pull it off tho.
« Last Edit: February 28, 2017, 07:44:19 am by Unicorn »
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

Offline gameblabla

  • Super User
  • Join Date: May 2015
  • Location:
  • Posts: 647
  • Post Rating Ratio: +11/-6
  • TI-nspire porter
    • View Profile
Re: CWick Contest #4: The Tau Problem
« Reply #4 on: February 28, 2017, 07:45:36 am »
Ok juju, i found a workaround for the small memory. (just do it in several parts)
Tau fits on two-screen !
I will send you the new version
  • Calculators owned: TI Nspire CX, TI-89

Offline Juju

  • aka Yuki Kagayaki aka J̵̭͕͇ù̞̭̝̯̦j̴̭̙̗͖͡ù͏͓̲̕
  • CodeWalrus Staff
  • Super User
  • Server Maintenance
  • Moderator
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Inside a walrus
  • Posts: 2836
  • Post Rating Ratio: +19/-1
  • Couch potato
    • jul.savard
    • juju2143
    • @juju2143
    • juju2143
    • @julosoft
    • juju-kun
    • /u/juju2143
    • juju2143
    • View Profile
    • Juju's shed
  • Gender: Female
  • WalriiPoints: 99999
Re: CWick Contest #4: The Tau Problem
« Reply #5 on: February 28, 2017, 08:18:25 am »
This reminds me... Did i ever get my Hello World walrii points? :P
Ah yeah, the WalriiPoints. I'll look at this later.

EDIT: Also, just a tip, you shouldn't merely store the output in the program and print it, some transformation or generation should be done.
EDIT2: Tip #2: If the language you picked only allows for a limited number of decimals, you should find an algorithm that can go over that limit. There's some algos that can print arbitrary digits.
« Last Edit: February 28, 2017, 08:24:25 am by Juju »
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????:trollface:???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

Offline DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18271
  • Post Rating Ratio: +91/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: CWick Contest #4: The Tau Problem
« Reply #6 on: February 28, 2017, 05:13:07 pm »
Woah nice @gameblabla . Also @Juju if 1000 is not an hard limit, then does it mean that the following code would have been acceptable in TI-83 Plus BASIC (at the cost of being nearly guaranteed to lose)? :trollface:

Code: [Select]
  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Offline Juju

  • aka Yuki Kagayaki aka J̵̭͕͇ù̞̭̝̯̦j̴̭̙̗͖͡ù͏͓̲̕
  • CodeWalrus Staff
  • Super User
  • Server Maintenance
  • Moderator
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Inside a walrus
  • Posts: 2836
  • Post Rating Ratio: +19/-1
  • Couch potato
    • jul.savard
    • juju2143
    • @juju2143
    • juju2143
    • @julosoft
    • juju-kun
    • /u/juju2143
    • juju2143
    • View Profile
    • Juju's shed
  • Gender: Female
  • WalriiPoints: 99999
Re: CWick Contest #4: The Tau Problem
« Reply #7 on: February 28, 2017, 08:08:37 pm »
I should put both of those tips I added in the post above in the OP.

EDIT: Here's my entry:

« Last Edit: February 28, 2017, 08:22:59 pm by Juju »
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????:trollface:???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

Offline JWinslow23

  • Pi is the coolest number in the history of math. :\
  • Super User
  • CW 4x3 challenge - 2nd place
  • *
  • Join Date: May 2015
  • Location: Somewhere between 13 and Graham's Number
  • Posts: 729
  • Post Rating Ratio: +10/-1
  • Use pi! Pi is the absolute greatest! :(
    • @UCu_9qD95nADzc-W6RN-3Z8A
    • 113/11328
    • View Profile
  • Gender: Male
Re: CWick Contest #4: The Tau Problem
« Reply #8 on: March 01, 2017, 01:33:56 am »
I just now noticed this.

I suppose I have to come up with something. TI-BASIC would be my target platform if I get this done, let's see if I can encode 1000 digits in less than 1KB. :P

EDIT: I already did this in <1KB, actually. For this specific problem, I optimized the previously-done (therefore invalid :P ) solution to 879 bytes, though it may not finish in the lifespan of your battery.

Code: [Select]
Goto 0
Lbl 1
If min(L₁)>0 and ᴇ10≥max(L₁
End
0→PMT
For([recursiven],1,dim(L₁
PMT+L₁([recursiven]→|N
int(|Nᴇ⁻10→PMT
|N-PMTᴇ10→L₁([recursiven]
End
If not(PMT
End
[recursiven]→dim(L₂
Ans→dim(ʟQ
Ans→dim(ʟR
Ans→dim(ʟT
PMT→L₁(Ans
End
Lbl 2
1+dim(L₁→|N
Repeat Ans or |N=1
|N-1→|N
L₁(|N)-L₂(|N
End
End
Lbl 0
SetUpEditor T,R,Q
{30→T
6Ans→R
{1→Q
ClrHome
"?→Str1
2→I%
Lbl 3
If 1<length(Str1
Then
"             
If not(fPart((length(Str1)-2)/16
Output(6+C,1,sub(Ans+Ans,1,16
2+16int((length(Str1)-114)/16)(130≤length(Str1
Output(1,1,sub(Str1,Ans,1-Ans+length(Str1
End
5ʟT→L₁
For(θ,⁻1,0
If θ
Goto 1
End
L₁→L₂
(9I%-4)ʟQ→L₁
For(θ,⁻1,0
If θ
Goto 1
End
3L₁+5ʟR→L₁
For(θ,⁻1,0
If θ
Goto 1
End
0→PV
For(θ,⁻1,0
If θ
Goto 2
End
While Ans≥0
PV+1→PV
L₁-L₂→L₁
For(θ,⁻2,0
If θ=⁻2
Goto 1
If θ
Goto 2
End
End
sub("0123456789",PV+1,1
If I%=2
Ans+".
Str1+Ans→Str1
(5I%-2)ʟQ+ʟR-PVʟT→L₁
For(θ,⁻1,0
If θ
Goto 1
End
30L₁→L₁
For(θ,⁻1,0
If θ
Goto 1
End
If I%<33
Then
9I%²+9I%+2
Else
(3I%+1)L₁→L₁
For(θ,⁻1,0
If θ
Goto 1
End
3I%+2
End
AnsL₁→L₁
For(θ,⁻1,0
If θ
Goto 1
End
L₁→ʟR
10I%ʟQ→L₁
For(θ,⁻1,0
If θ
Goto 1
End
(2I%-1)L₁→L₁
For(θ,⁻1,0
If θ
Goto 1
End
L₁→ʟQ
3ʟT→L₁
For(θ,⁻1,0
If θ
Goto 1
End
If I%<33
Then
9I%²+9I%+2
Else
(3I%+1)L₁→L₁
For(θ,⁻1,0
If θ
Goto 1
End
3I%+2
End
AnsL₁→L₁
For(θ,⁻1,0
If θ
Goto 1
End
L₁→ʟT
I%+1→I%
If getKey≠45 and 1003>length(Str1
Goto 3
If 1003=length(Str1
Pause
ClrHome

Online c4ooo

  • ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  • Super User
  • CW Contest II Winner
  • *
  • Join Date: Aug 2015
  • Location: 127.0.0.1
  • Posts: 918
  • Post Rating Ratio: +9/-2
  • ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
    • View Profile
  • Gender: Male
Re: CWick Contest #4: The Tau Problem
« Reply #9 on: March 01, 2017, 03:21:41 am »
If someone could post an algorithm to find all the terms of tao in succession i would be willing to golf something up in axe.

Offline JWinslow23

  • Pi is the coolest number in the history of math. :\
  • Super User
  • CW 4x3 challenge - 2nd place
  • *
  • Join Date: May 2015
  • Location: Somewhere between 13 and Graham's Number
  • Posts: 729
  • Post Rating Ratio: +10/-1
  • Use pi! Pi is the absolute greatest! :(
    • @UCu_9qD95nADzc-W6RN-3Z8A
    • 113/11328
    • View Profile
  • Gender: Male
Re: CWick Contest #4: The Tau Problem
« Reply #10 on: March 01, 2017, 03:55:39 am »
If someone could post an algorithm to find all the terms of tao in succession i would be willing to golf something up in axe.
*tau

And I just posted one. :P

Also, I'm working on my TI-BASIC version, and right now, it's 505 digits in 428 bytes (including the 6. at the beginning). That's about 1.18 digits per byte!

Online c4ooo

  • ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  • Super User
  • CW Contest II Winner
  • *
  • Join Date: Aug 2015
  • Location: 127.0.0.1
  • Posts: 918
  • Post Rating Ratio: +9/-2
  • ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
    • View Profile
  • Gender: Male
Re: CWick Contest #4: The Tau Problem
« Reply #11 on: March 01, 2017, 09:00:42 pm »
If someone could post an algorithm to find all the terms of tao in succession i would be willing to golf something up in axe.
*tau

And I just posted one. :P
One that isn't in TI-BASIC :P


Offline JWinslow23

  • Pi is the coolest number in the history of math. :\
  • Super User
  • CW 4x3 challenge - 2nd place
  • *
  • Join Date: May 2015
  • Location: Somewhere between 13 and Graham's Number
  • Posts: 729
  • Post Rating Ratio: +10/-1
  • Use pi! Pi is the absolute greatest! :(
    • @UCu_9qD95nADzc-W6RN-3Z8A
    • 113/11328
    • View Profile
  • Gender: Male
Re: CWick Contest #4: The Tau Problem
« Reply #13 on: March 02, 2017, 06:33:37 pm »
Bump.

I've been working on the spigot, and if I let it go infinitely and display one digit at a time, I can get it down to 383 bytes.
Code: [Select]
{30→T
6Ans→R
{1→Q
ClrHome
For(I,2,ᴇ4
⁻1→V
5ʟT
For(θ,V,0
If θ
Goto 1
End
ʟA→B
Ans+3(9I-4)ʟQ+5ʟR→A
Repeat Ans<0
IS>(V,9
ʟA-ʟB
For(θ,⁻1,0
If θ
Goto 1
End
End
Disp V
(5I-2)ʟQ+ʟR-VʟT
For(W,0,1
For(Z,1,2
If W
(3I+Z)ʟA
For(θ,⁻1,0
If θ
Goto 1
End
30ʟA
End
End
ʟA→R
10IʟQ
For(W,⁻1,0
For(Z,1,2
If not(W
(3I+Z)ʟA
For(θ,⁻1,0
If θ
Goto 1
End
(2I-1)ʟA
End
If W
ʟA→Q
If W
3ʟT→A
End
ʟA→T
End
Lbl 1
DelVar PAns→A
For(M,1,dim(ʟA
P+ʟA(M→N
int(Ansᴇ⁻9→P
N-Ansᴇ9→ʟA(M
End
If P
P→ʟA(M
dim(ʟA→dim(ʟB
Ans→dim(ʟQ
Ans→dim(ʟR
Ans→dim(ʟT
Ans→N
Repeat Ans or not(N
ʟA(N)-ʟB(N
DS<(N,0
End
End

Offline kotu

  • Walrus Extender Utils
  • Super User
  • Join Date: Aug 2016
  • Location: UK
  • Posts: 922
  • Post Rating Ratio: +7/-7
    • profile.php?id=100010378444176
    • dj_kotu
    • @UCAy2ZF4hbc08iStnTn6jgxQ
    • rowanmedhurst
    • @djkotu
    • @romanov-psyco
    • View Profile
    • futurerave.uk
  • Gender: Male
Re: CWick Contest #4: The Tau Problem
« Reply #14 on: March 03, 2017, 04:22:34 am »
I'm not joining in because it looks too hard but I found this.....

"Are you trying compute ALL the digits from the first to the Nth? Or are you just trying to get a few digits around the Nth binary digit? There is no reason to use the BBP formula if you want all the digits as there are MUCH faster formulas out there for Pi."
  • Calculators owned: TI 84+CE-T
  • Consoles, mobile devices and vintage computers owned: Sega Master System, Sony PS3
we not doing it.
UPDATE we are not doing it.
proud member of the MATEOCONLECHUGA fansite.

 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games