Twinkle and Sprinkle: Difference between revisions
Content added Content deleted
(draft task removed) |
(Added BASIC256, FreeBASIC and Yabasic.) |
||
Line 8: | Line 8: | ||
So I went ahead and wrote a Python program that, instead of crunching numbers, depended on the human brain to gain insight enough to hard code in the correct numbers. Perhaps your program will contain different numbers. |
So I went ahead and wrote a Python program that, instead of crunching numbers, depended on the human brain to gain insight enough to hard code in the correct numbers. Perhaps your program will contain different numbers. |
||
=={{header|BASIC}}== |
|||
==={{header|BASIC256}}=== |
|||
{{trans|Python}} |
|||
See Python entry for explanatory comments (which have been omitted for clarity) |
|||
<syntaxhighlight lang="vb">CR = chr(10) |
|||
txt = CR + " Heart attack rates, according to the incurious" |
|||
txt += CR + " Women Men Overall" |
|||
txt += CR + " Twinkle (predicted) 0 1 0.5" |
|||
txt += CR + " Sprinkle (observed) 0 1 0.5" |
|||
txt += CR + "" |
|||
txt += CR + " Heart attack rates, according to the incurious" |
|||
txt += CR + " Women Men Overall" |
|||
txt += CR + " Twinkle (predicted) ??? ??? ???" |
|||
txt += CR + " Sprinkle (observed) 0 1 0.5" |
|||
txt += CR + "" |
|||
txt += CR + " Heart attack rates, according to Dr. Godzilla" |
|||
txt += CR + " Women Men Overall" |
|||
txt += CR + " Twinkle (predicted) 0 0 0" |
|||
txt += CR + " Sprinkle (observed) 0 1 0.5" |
|||
txt += CR + "" |
|||
txt += CR + " Heart attack rates, according to observers" |
|||
txt += CR + " Women Men Overall" |
|||
txt += CR + " Twinkle (observed) 0 1 0.5" |
|||
txt += CR + " Sprinkle (observed) 0 1 0.5" |
|||
txt += CR + "" |
|||
txt += CR + " Output of an AI of a "+chr(34)+"Godzilla's theorem"+chr(34)+" adherent" |
|||
txt += CR + "However strange it may seem, heart attacks in Twinkle and" |
|||
txt += CR + "Sprinkle are now scientifically proven to involve some kind" |
|||
txt += CR + "of violation of causal reality." |
|||
txt += CR + "" |
|||
txt += CR + " Output of an AI of a very intellectual person" |
|||
txt += CR + "Adherents to "+chr(34)+"Godzilla's theorem"+chr(34)+" are society's greatest" |
|||
txt += CR + "geniuses, so what they say is true." + CR |
|||
print txt</syntaxhighlight> |
|||
{{out}} |
|||
<pre>Same as Python entry.</pre> |
|||
==={{header|FreeBASIC}}=== |
|||
{{trans|Python}} |
|||
See Python entry for explanatory comments (which have been omitted for clarity) |
|||
<syntaxhighlight lang="vb">Dim As String txt = "" |
|||
txt &= !"\n Heart attack rates, according to the incurious" |
|||
txt &= !"\n Women Men Overall" |
|||
txt &= !"\n Twinkle (predicted) 0 1 0.5" |
|||
txt &= !"\n Sprinkle (observed) 0 1 0.5" |
|||
txt &= !"\n" |
|||
txt &= !"\n Heart attack rates, according to the incurious" |
|||
txt &= !"\n Women Men Overall" |
|||
txt &= !"\n Twinkle (predicted) ??? ??? ???" |
|||
txt &= !"\n Sprinkle (observed) 0 1 0.5" |
|||
txt &= !"\n" |
|||
txt &= !"\n Heart attack rates, according to Dr. Godzilla" |
|||
txt &= !"\n Women Men Overall" |
|||
txt &= !"\n Twinkle (predicted) 0 0 0" |
|||
txt &= !"\n Sprinkle (observed) 0 1 0.5" |
|||
txt &= !"\n" |
|||
txt &= !"\n Heart attack rates, according to observers" |
|||
txt &= !"\n Women Men Overall" |
|||
txt &= !"\n Twinkle (observed) 0 1 0.5" |
|||
txt &= !"\n Sprinkle (observed) 0 1 0.5" |
|||
txt &= !"\n" |
|||
txt &= !"\n Output of an AI of a \"Godzilla's theorem\" adherent" |
|||
txt &= !"\nHowever strange it may seem, heart attacks in Twinkle and" |
|||
txt &= !"\nSprinkle are now scientifically proven to involve some kind" |
|||
txt &= !"\nof violation of causal reality." |
|||
txt &= !"\n" |
|||
txt &= !"\n Output of an AI of a very intellectual person" |
|||
txt &= !"\nAdherents to \"Godzilla's theorem\" are society's greatest" |
|||
txt &= !"\ngeniuses, so what they say is true.\n" |
|||
Print txt</syntaxhighlight> |
|||
{{out}} |
|||
<pre>Same as Python entry.</pre> |
|||
==={{header|Yabasic}}=== |
|||
{{trans|Python}} |
|||
See Python entry for explanatory comments (which have been omitted for clarity) |
|||
<syntaxhighlight lang="vb">txt$ = "\n Heart attack rates, according to the incurious" |
|||
txt$ = txt$ + "\n Women Men Overall" |
|||
txt$ = txt$ + "\n Twinkle (predicted) 0 1 0.5" |
|||
txt$ = txt$ + "\n Sprinkle (observed) 0 1 0.5" |
|||
txt$ = txt$ + "\n" |
|||
txt$ = txt$ + "\n Heart attack rates, according to the incurious" |
|||
txt$ = txt$ + "\n Women Men Overall" |
|||
txt$ = txt$ + "\n Twinkle (predicted) ??? ??? ???" |
|||
txt$ = txt$ + "\n Sprinkle (observed) 0 1 0.5" |
|||
txt$ = txt$ + "\n" |
|||
txt$ = txt$ + "\n Heart attack rates, according to Dr. Godzilla" |
|||
txt$ = txt$ + "\n Women Men Overall" |
|||
txt$ = txt$ + "\n Twinkle (predicted) 0 0 0" |
|||
txt$ = txt$ + "\n Sprinkle (observed) 0 1 0.5" |
|||
txt$ = txt$ + "\n" |
|||
txt$ = txt$ + "\n Heart attack rates, according to observers" |
|||
txt$ = txt$ + "\n Women Men Overall" |
|||
txt$ = txt$ + "\n Twinkle (observed) 0 1 0.5" |
|||
txt$ = txt$ + "\n Sprinkle (observed) 0 1 0.5" |
|||
txt$ = txt$ + "\n" |
|||
txt$ = txt$ + "\n Output of an AI of a \"Godzilla's theorem\" adherent" |
|||
txt$ = txt$ + "\nHowever strange it may seem, heart attacks in Twinkle and" |
|||
txt$ = txt$ + "\nSprinkle are now scientifically proven to involve some kind" |
|||
txt$ = txt$ + "\nof violation of causal reality." |
|||
txt$ = txt$ + "\n" |
|||
txt$ = txt$ + "\n Output of an AI of a very intellectual person" |
|||
txt$ = txt$ + "\nAdherents to \"Godzilla's theorem\" are society's greatest" |
|||
txt$ = txt$ + "\ngeniuses, so what they say is true.\n" |
|||
print txt$</syntaxhighlight> |
|||
{{out}} |
|||
<pre>Same as Python entry.</pre> |
|||
=={{header|Phix}}== |
=={{header|Phix}}== |
||
Line 47: | Line 158: | ||
<span style="color: #7060A8;">puts</span><span style="color: #0000FF;">(</span><span style="color: #000000;">1</span><span style="color: #0000FF;">,</span><span style="color: #000000;">txt</span><span style="color: #0000FF;">)</span> |
<span style="color: #7060A8;">puts</span><span style="color: #0000FF;">(</span><span style="color: #000000;">1</span><span style="color: #0000FF;">,</span><span style="color: #000000;">txt</span><span style="color: #0000FF;">)</span> |
||
<!--</syntaxhighlight>--> |
<!--</syntaxhighlight>--> |
||
{{out}} |
|||
Output same as Python |
|||
<pre>Output same as Python</pre> |
|||
=={{header|Python}}== |
=={{header|Python}}== |