previndexinfonext

code guessing, round #88 (completed)

started at ; stage 2 at ; ended at

specification

I heard that instead of "sorry", you should say "thank you". so thanks for being late. play fizzbuzz again, kinda. submissions may be written in any language.

fizzbuzz is a children's word game and a timeless programming problem. we'll do a variant of it today. normally, you list the natural numbers, but replace those divisible by 3 with "Fizz", those divisible by 5 with "Buzz", and those divisible by 15 with "FizzBuzz". it goes like this: [1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, FizzBuzz, ...]. here we'll do similar, but with 3 and 5 replaced with different numbers.

you can use any divisors you want in place of 3 and 5, as long as they are neither 3 nor 5. here's a valid example where I use 2 and 7 instead: [1, Fizz, 3, Fizz, 5, Fizz, Buzz, Fizz, 9, Fizz, 11, Fizz, 13, FizzBuzz, 15].

your challenge is to produce as many terms as you like of any such modified fizzbuzz sequence you like. as any language is allowed, there is no fixed API.

results

  1. 👑 LyricLy +5 -2 = 3
    1. hyacinth (was oleander)
    2. essaie (was haru~)
    3. seshoumara
    4. kimapr
    5. oleander (was *Ada)
    6. *Ada (was olive)
    7. olive (was essaie)
    8. Dolphy
    9. Indigo
    10. haru~ (was hyacinth)
    11. Makefile_dot_in
  2. haru~ +3 -1 = 2
    1. kimapr (was oleander)
    2. LyricLy (was seshoumara)
    3. Indigo (was kimapr)
    4. *Ada
    5. olive
    6. hyacinth (was essaie)
    7. Dolphy
    8. Makefile_dot_in (was LyricLy)
    9. oleander (was Indigo)
    10. essaie (was hyacinth)
    11. seshoumara (was Makefile_dot_in)
  3. oleander +2 -0 = 2
    1. hyacinth (was haru~)
    2. Indigo (was seshoumara)
    3. Makefile_dot_in (was kimapr)
    4. olive (was *Ada)
    5. essaie (was olive)
    6. haru~ (was essaie)
    7. Dolphy
    8. LyricLy
    9. kimapr (was Indigo)
    10. *Ada (was hyacinth)
    11. seshoumara (was Makefile_dot_in)
  4. Makefile_dot_in +3 -2 = 1
    1. seshoumara (was oleander)
    2. LyricLy (was haru~)
    3. oleander (was seshoumara)
    4. kimapr
    5. haru~ (was *Ada)
    6. olive
    7. essaie
    8. Indigo (was Dolphy)
    9. Dolphy (was LyricLy)
    10. hyacinth (was Indigo)
    11. *Ada (was hyacinth)
  5. kimapr +3 -3 = 0
    1. seshoumara (was oleander)
    2. oleander (was haru~)
    3. haru~ (was seshoumara)
    4. *Ada
    5. essaie (was olive)
    6. LyricLy (was essaie)
    7. Dolphy
    8. Makefile_dot_in (was LyricLy)
    9. Indigo
    10. olive (was hyacinth)
    11. hyacinth (was Makefile_dot_in)
  6. Indigo +3 -3 = 0
    1. *Ada (was oleander)
    2. haru~
    3. kimapr (was seshoumara)
    4. LyricLy (was kimapr)
    5. olive (was *Ada)
    6. essaie (was olive)
    7. oleander (was essaie)
    8. Dolphy
    9. Makefile_dot_in (was LyricLy)
    10. hyacinth
    11. seshoumara (was Makefile_dot_in)
  7. *Ada +2 -2 = 0
    1. olive (was oleander)
    2. essaie (was haru~)
    3. LyricLy (was seshoumara)
    4. kimapr
    5. seshoumara (was olive)
    6. haru~ (was essaie)
    7. Indigo (was Dolphy)
    8. oleander (was LyricLy)
    9. hyacinth (was Indigo)
    10. Dolphy (was hyacinth)
    11. Makefile_dot_in
  8. essaie +1 -1 = 0
    1. *Ada (was oleander)
    2. Dolphy (was haru~)
    3. seshoumara
    4. oleander (was kimapr)
    5. hyacinth (was *Ada)
    6. LyricLy (was olive)
    7. kimapr (was Dolphy)
    8. Indigo (was LyricLy)
    9. Makefile_dot_in (was Indigo)
    10. olive (was hyacinth)
    11. haru~ (was Makefile_dot_in)
  9. hyacinth +1 -1 = 0
    1. seshoumara (was oleander)
    2. essaie (was haru~)
    3. Indigo (was seshoumara)
    4. oleander (was kimapr)
    5. olive (was *Ada)
    6. Makefile_dot_in (was olive)
    7. haru~ (was essaie)
    8. Dolphy
    9. *Ada (was LyricLy)
    10. kimapr (was Indigo)
    11. LyricLy (was Makefile_dot_in)
  10. seshoumara +1 -2 = -1
    1. LyricLy (was oleander)
    2. *Ada (was haru~)
    3. Makefile_dot_in (was kimapr)
    4. oleander (was *Ada)
    5. Indigo (was olive)
    6. kimapr (was essaie)
    7. Dolphy
    8. hyacinth (was LyricLy)
    9. essaie (was Indigo)
    10. olive (was hyacinth)
    11. haru~ (was Makefile_dot_in)
  11. olive +0 -2 = -2
    1. seshoumara (was oleander)
    2. hyacinth (was haru~)
    3. kimapr (was seshoumara)
    4. LyricLy (was kimapr)
    5. Makefile_dot_in (was *Ada)
    6. haru~ (was essaie)
    7. Indigo (was Dolphy)
    8. Dolphy (was LyricLy)
    9. *Ada (was Indigo)
    10. essaie (was hyacinth)
    11. oleander (was Makefile_dot_in)
  12. Dolphy +2 -7 = -5
    1. seshoumara (was oleander)
    2. Makefile_dot_in (was haru~)
    3. hyacinth (was seshoumara)
    4. *Ada (was kimapr)
    5. oleander (was *Ada)
    6. kimapr (was olive)
    7. olive (was essaie)
    8. LyricLy
    9. Indigo
    10. essaie (was hyacinth)
    11. haru~ (was Makefile_dot_in)

entries

you can download all the entries

entry #1

written by oleander
submitted at
1 like

guesses
comments 0

post a comment


SIX SEVEN.awk Unicode text, UTF-8 text, with no line terminators
1
BEGIN {for (i = 1; i <= 200; i++) {print (i % 42 == 0) ? "FizzBuzz" : (i % 6 == 0) ? "Fizz" : (i % 7 == 0) ? "Buzz" : i}} #six seveeen 😂😂😂😂😂😂

entry #2

written by haru~
submitted at
1 like

guesses
comments 0

post a comment


cg88.txt ASCII text, with CRLF line terminators
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
FizzBuzz is in fact a simple problem. Print the natural
numbers in ascending order. If the number should be
divisible by 3 print Fizz instead. If the number should be
divisible by 5 print Buzz instead. If the number should be
divisible by both 3 and 5 print FizzBuzz instead. Otherwise
continue with the status quo. This indeed is the principle
of FizzBuzz.

The problem is trivial and not more complicated than it
seems. For this reason it is often an introductory problem.
So introductory that it often appears only second to the
Hello World problem.

"FizzBuzz is too easy; it provides no pedagogical value.
There is no real reason to have to do this... Implementing
FizzBuzz is too trivial of a task to develop any real
skill... Teachers should pick a harder problem... Skibi- We
already have Hello World, FizzBuzz is an extraneous problem
isn't it"

Students' cries echo along the corridors; their screams
melting into anguished cries; their grievances plastered
across the walls; their tuition fees left unjustified...

"FizzBuzz, O FizzBuzz - You teach nothing more than basic
input and output. You teach nothing more than how to divide.
You teach nothing more than basic loops. You have no
satisfying end. Equinumerous with the natural numbers you
are. You have no purpose beyond padding the payslips of
teacher assistants. You have no reason for existing. Why do
you exist at all... You are worthless; you're nothing but a
second Leetcode problem"

That's not just what students say - for I too bear such
greviances. FizzBuzz is a poor excuse of a task for the mere
computing student. It has no clear teleology; it has no
spirit, nor any spine of its own; it lacks character; it
lacks value; it lacks aesthetic; it lacks style; it begs for
attention; it has an unworthy amount of popularity; it has
no calling; it has no reason to be so reknowned; it steals
the light from more worthy problems; it requires no more
knowledge than a random hammering of tokens; it is
purposeless, inane, asinine; I despise it. It is horrid.
FizzBuzz is a poor excuse of a problem. Its creator hides
their name in shame. Every instance I see of it makes me cry
tears of blood...

"But think about it, it has to be popular for a reason; it
would not be so popular if it were as worthless as you
describe. It is aimed towards fresh students of the craft.
It guides their hands gingerly. It paves the way to future
understanding. It poses a simple problem to offer them the
confidence of a problem solved. It has worth. It has
purpose. It has character. It is kind. It is gentle. It
is-'"

No it isn't; for this is what I have to say: "You fool, you
absolute bafoon; you complete and utter dimwit. You yourself
have fallen prey to its demands; its unholy grasp on society
plagues you without knowing. It is unkind; it is rough and
uncouth. It is not as gentle as it seems; it lures students
in with a false sense of security. Think about it - no real
programming problem is as simple - real as in in the
real-world that is - that's the crux of the issue there"

It's nothing but a siren song. You know for yourself the
true nature of the problems that lay out there. The codes
that lay uncoded; the keys that beckon to be pressed in
their divine order; the interview questions that beg to be
asked are not as kind as he. FizzBuzz is no friend. FizzBuzz
is a liar. A pathological liar; a sociopath; a charlatan; he
leads one to the sin of pride and laughs as you fall.

You fool. You absolute fool. You have no idea what a
sickening beast you seek to defend. You laugh in its company
yet you do not understand. Its facimile of a smile has
ensnared you. You are naive. You shall further its cause no
longer.

"I am not complicit, I am in no poor company - FizzBuzz is a
friend. FizzBuzz could do no wrong... It is no back-stabbing
evil that you describe. The outside world is scary indeed.
For this reason FizzBuzz provides company. Company in which
one can find solace. It is the evergreens - the saplings on
the forest floor that we need such a kind canopy to shelter.
The harshness of reality does not demand an introduction of
equal harshness. It is even more purposeless than you claim
to demand it so. FizzBuzz is perfect for this endeavour. It
is indeed kind; it is indeed gentle; it is indeed
purposeful; it's a problem that deserves to be displayed
with pride"

That's another of your mistakes. Your concerns are indeed
valid. However answers are not found in FizzBuzz. For this
reason we already have Hello World. Hello World triumphs
over FizzBuzz in this regard.

"But your earlier arguments apply to Hello World then, the
razor-sharp words you have spoken against FizzBuzz share a
premise with it. Hello World is simple too. Hello World
merely asks one to print a simple statement. It does not
even cover loops. In this regard - you contradict yourself.
You have spoken such ascerbic words against FizzBuzz yet
seek to legitimise a lesser problem by your own standards.
You ought not to hold such double standards. In your
endeavour to lambast FizzBuzz you have stepped over your own
toes. If FizzBuzz has the faults you claim so shall Hello
World too; if FizzBuzz is as worthless of a problem as you
proclaim so shall Hello World be in turn; you're wrong
either way"

That is another reason why you're sorely mistaken; another
reason why the wool has been pulled over your eyes; Hello
World, the original, is a purer form; Hello World commits no
such wrongdoings. Its simplicity is benign. Unlike FizzBuzz
it makes no real claim of being a true programming problem.
It is so trivial as to be asinine to think of as one. In
fact many barely regard it as a problem at all. Merely the
simplest of code to execute and demonstrate the most
fundamental aspects of the language.

"If so, your standards are unclear; it is easy to defend
Hello World in this manner with vague terms. FizzBuzz may
very well be as trivial as you claim Hello World to be. The
addition of a simple loop surely does not constitute an
admission of problem legitimacy. It is conceivable that one
may regard FizzBuzz to have the same ontology as Hello World
as you describe. It is just as clearly a demonstration as
you describe. By your own standards it is no more than a
simple sequence of code to execute. There is no more to it
than what Hello World proscribes. Thus by your own argument
FizzBuzz should be cleared of all transgressions. It is not
contradictory to either of our arguments to claim it so. You
have said it yourself. FizzBuzz is merely a task second to
Hello World. A deuteragonist - that's all it really claims
to be"

That's no more of a cogent argument as your first; verily I
say unto you: "You do not see, you do not hear; you speak
but do not heed your own tongue. The first is an
introduction; the second a harder calling. There is no book
that needs two first chapters; for this reason the second
loses claim of being the prolegomenon. The second must
therefore be a more serious step into the foray; but in this
calling FizzBuzz fails in all regards. Not a prelude - a
test - its time-wasting sight-blinding nature continues to
laugh at students' dismay"

That's the true folly of your argument. The true extent of
your fallacy. It cannot be another Hello World. It is
impossible; nay impractical; nay imperceivable to claim it
so. It is unsound to make that claim; thus my arguments
remain justified. It deceives. It does indeed present itself
to be more than just a trivial test. Hello World is oft a
task completed by even those unserious in their craft. Those
who want merely a glimpse at what there is to come. That is
dissimilar to the nature of FizzBuzz. FizzBuzz demands more
than just a line of code; it demands no less than a modicum
of effort. To little to pose a teachable experience. Too
much to be excused as a simple taste.

Your insouciance and callous disbelief is threatening. Cease
this defence at once. The more excuses you develop for
FizzBuzz the deeper of a hole you dig for yourself. It is no
friend; leave it behind. Find better problems. Gift fellow
students a better learning experience. It may be too late
for yourself who hath been deceived. But it is not too late
for those who come after. Do not prescribe FizzBuzz as one
might cheap medication. It is a poison. See the error of
your ways.

"Very well then, perhaps FizzBuzz has its errors - perhaps
numerously so. But surely it effects no real damage. Surely
it does no harm. It's no malignant tumour. It is no more
than a low-value teaching aid. It may be true that no value
is gained. But this does not necessitate that it does harm.
It is at most a mild inconvenience. It wields a dull-bladed
knife. It is no worse than when a teacher goes on a rant
about some unrelated matter. Thus there is no justification
to chastise and warn against the addition of FizzBuzz into
curricula. You are overreacting. There is no real danger;
there is no cause for alarm; there is no urgency; this is no
grave matter"

It is more than a grave matter. It is a matter of great
urgency. It is most definitely a cause for alarm. FizzBuzz's
apparant innocence transcends more than just a basic
discourtesy. Step into the shoes of a student for a moment.
Observe their thinking as they some under its slimy touch.

Listen as they think: "Hmm, this must be my first real
challenge - my first actual task. I've completed Hello World
and am now more deeply invested in learning this programming
language. I am committed to learning more than just a single
command. This well-formatted problem statement seems simple.
Nonetheless it remains more challenging than Hello World.
Even though it is simple this must surely represent some
level of challenge I might face in the future. Behold - I
have conquered this task. I made use of more advanced syntax
and conquered this problem. I am prepared to conquer other
tasks. Surely the depth of this language must not be
unsurmountable; surely I must be primed to tackle more
advanced tasks; I understand this language now; I have
proven more than just a cursory grasp"

You see the problem now; you see the true evil beyond its
kind visage; it is far from benign, for it bears too much
undue legitimacy and emphasis as an example of a
prototypical programming task, yet is far from
representative of the upper limits of programs'
complexities; we ought not to herald it as more than a
trivial task, yet its position after Hello World often
effects that perception, a perception challenging to battle
against alone, for such is the sordid truth of FizzBuzz.

"I understand it now, I understand FizzBuzz's evil - so
shall it Fizz and Buzz left in times medieval."

',--",;;;.;..",,;..'"',,;...",,,-,,;.;,"--..";'"'..",,;..'",
,-"';..",,.",-.'"',;;",'"'.....",,,,;....'"',,;",;.-'"';;"!;
'"'..",,;..'"",,;..."',,,.",-.'"',;;,".;..........--",;.;,";
.;;'"                                                  ';"."
,-.;'                                                  ";.;;
"----                                                  --"';
;",'"              ANTIFIZZBUZZ MANIFESTO              ';;;.
.....                                                  ....-
",;,"                                                  ;.;;'
"';".                                                  ",-.;
'";.;;"-'--'--"';",'"';;";..'...'.",-...'..''...';'"'-!--.;.
;",'"''"'-"-",;,-'"'..'...'.",;....''....-'"';!",'""'--..'..
.'.",-.'.''...''.'..;'"'-!",'"'-''-",-.;'"''''"--'-!'-"'''''

entry #3

written by seshoumara
submitted at
0 likes

guesses
comments 0

post a comment


cg88_fizzbuzz.pl ASCII text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
main :- read(Nth_term), read(D1), read(D2), loop(Nth_term, D1, D2).

loop(Nth_term, D1, D2) :- between(1, Nth_term, N), fizzbuzz(N, D1, D2), fail.
loop(_, _, _).

fizzbuzz(N, D1, D2) :- divisible(N, D1), divisible(N, D2), !, writeln('FizzBuzz').
fizzbuzz(N, D1, _) :- divisible(N, D1), !, writeln('Fizz').
fizzbuzz(N, _, D2) :- divisible(N, D2), !, writeln('Buzz').
fizzbuzz(N, _, _) :- writeln(N).

divisible(A, B) :- (A mod B) =:= 0.

entry #4

written by kimapr
submitted at
0 likes

guesses
comments 0

post a comment


spinning-line-remix.js ASCII text, with very long lines (750)
1
/* diagram zoom <= 1/16 */x=(t/16/16)|0,y=t%16,t||(f=(f=>(x,y,i)=>(i=(min(120,max(0,x))|0)+120*(min(16,max(0,y))|0),((f[i/8|0]>>(i%8))&1)*255))(Uint8Array.fromBase64('A'.repeat(40)+'GBgcHCA8OH4cHHwYAB4APB4+PjA+fH5+Pn4YAH4AZhhgYDgGBmBmZgYAAGYAZhhgYDgGAiBmYgYefmZmQhhgMDQ+PjB+YgYYYHZmWhgwPDZwZjA8Zn4YMD5mWhgYYDJgZhhmfgYYGGZmZhgYYP9gRhhCeAYYCMZmZhgMYDBgZhhiYAYYDEZmdnx+djByZgxmNgZ+fn52PHx+PiA+PAw8HAZ+fj58'+'A'.repeat(60))),ocx=1/0,c=0,cm=Object.fromEntries([...'0123456789FizBu'].map((e,i)=>[e,i]))),cx=x/8|0,icx=x%8,cx==ocx||(ocx<cx||(it=(function*(){[a,b]=[2,7];for(i=1;;i++)yield i%2?(i%7?i:'Buzz'):(i%7?'Fizz':'FizzBuzz')})().flatMap(e=>[...(e+' ')]),ocx=-1),(()=>{while(ocx<cx-1)it.next(),ocx++})(),c=it.next().value,ocx=cx),f((cm[c]??-1)*8+icx,y)

entry #5

written by *Ada
submitted at
0 likes

guesses
comments 0

post a comment


fizz.lua ASCII text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
local otter = 4
local deer = 6
local snake = otter * deer
local lombax = 0

while 1 do
    lombax = lombax + 1
    if (lombax % snake) == 0 then
        io.write("FizzBuzz ")
    elseif (lombax % deer) == 0 then
        io.write("Buzz ")
    elseif (lombax % otter) == 0 then
        io.write("Fizz ")
    else
        io.write(string.format("%d ", lombax))
    end
end

entry #6

written by olive
submitted at
1 like

guesses
comments 0

post a comment


fixxboxx.lua Unicode text, UTF-8 text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/local/bin/luajit-2.1.1753364724

do local a,b,l = ...
a,b,l = tonumber(a) or 19, tonumber(b) or 17, tonumber(l) or 0
function lick(c) l=l+1 return (" "):rep(l)..c end local i = 0 repeat i=i+1 print(                   
	(i%a==0 and i%b==0 and lick(lick("FiipBoxx"))) or (i%a==0 and lick("Fiyy")) or (i%b==0 and lick("Burks")) or i 
) until i%a+i%b==0 end

setmetatable(_G,{__index=function()return print end})
there( once( was( a( sailor( who( went( to( sea(
	their( name( was( something( like( glimmy( owl( bee(
		i( ate( a( fish( £and( now( Ihm( free(
			on( the( french( acheilegiapo(
					yoim( exclamationmark())
	))))
		))))))))
))))))))
	)))))))))

iing "two and two spacing apart,how the cross and wrap adart,"
jijd "in reverse the close or part? which is the real part>"
yoiym"yoiym!〃"
oh"how they have collapsed, become one with a  clinkle nadn rop"
exactly"two they be on you, just how will you cope it through?"

entry #7

written by essaie
submitted at
0 likes

guesses
comments 0

post a comment


file.txt ASCII text
1
2
3
4
5
6
7
8
i = int(input("do the thing:3 "))
a = i+1
b= a+1

if {a, b} & {3, 5}: 
 a = 67
 b = 69
for n in range(i): print(n+1)

entry #8

written by Dolphy
submitted at
1 like

guesses
comments 0

post a comment


sounds_and_beats.p8.png PNG image data, 160 x 205, 8-bit/color RGBA, non-interlaced

entry #9

written by LyricLy
submitted at
1 like

guesses
comments 0

post a comment


out.hs ASCII text
1
2
3
4
5
6
7
import Control.Applicative
import Data.Bool

fizzbuzz :: Int -> String
fizzbuzz = ($ id) . ((.) <$> ($ "fizz") . ($ 6) <*> ($ "buzz") . ($ 7)) . ((bool (const id) ((const .) . (. ($ "")) . (++)) . (== 0)) .) . mod <*> show

main = print $ map fizzbuzz [1..100]

entry #10

written by Indigo
submitted at
0 likes

guesses
comments 0

post a comment


c8.c ASCII text
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define A(NAME, TYPE)                                                         \
  typedef struct NAME                                                         \
  {                                                                           \
    TYPE *b;                                                                  \
    size_t s;                                                                 \
    size_t c;                                                                 \
  } NAME;                                                                     \
  void NAME##I (NAME *a)                                                      \
  {                                                                           \
    a->b = NULL;                                                              \
    a->s = 0;                                                                 \
    a->c = 0;                                                                 \
  }                                                                           \
  void NAME##D (NAME *a) { free (a->b); }                                     \
  void NAME##R (NAME *a, size_t c)                                            \
  {                                                                           \
    a->b = realloc (a->b, c * sizeof (TYPE));                                 \
    a->c = c;                                                                 \
    a->s = a->s > a->c ? a->c : a->s;                                         \
  }                                                                           \
  void NAME##P (NAME *a, TYPE v)                                              \
  {                                                                           \
    if (a->s == a->c)                                                         \
      {                                                                       \
        NAME##R (a, a->c == 0 ? 16 : a->c * 2);                               \
      }                                                                       \
    a->b[a->s++] = v;                                                         \
  }

A (S, char)
A (C, uint64_t)
A (D, char const *)

typedef struct O O;

typedef enum T
{
  TO,
  TS,
  TN,
  TP,
} T;

typedef struct V
{
  T t;
  union
  {
    double n;
    O *o;
    char const *s;
    uint64_t const *p;
  };
} V;

typedef struct O
{
  bool m;
  O *n;
  size_t c;
  V f[];
} O;

enum P : uint8_t
{
  I0,
  I1,
  I2,
  I3,
  I4,
  I5,
  I6,
  I7,
  I8,
  I9,
  I10,
  I11,
  I12,
  I13,
  I14,
  I15,
  I16,
  I17,
  I18,
  I19,
  I20,
  I21,
};

typedef struct L
{
  C i;
  D d;
} L;

void
LI (L *c)
{
  CI (&c->i);
  DI (&c->d);
}

typedef struct F
{
  uint64_t const *r;
  size_t b;
} F;

A (FA, F)
A (VA, V)

typedef struct M
{
  L *c;
  O *h;
  VA s;
  FA f;
  uint64_t const *i;
} M;

void
MI (M *m, L *c)
{
  m->c = c;
  m->h = NULL;
  VAI (&m->s);
  FAI (&m->f);
  m->i = c->i.b;
}

void
MD (M *m)
{
  VAD (&m->s);
  FAD (&m->f);
  for (O *p = m->h; p; p = p->n)
    {
      free (p);
    }
}

static int64_t
im (uint64_t i)
{
  struct
  {
    int64_t x : 56;
  } s;
  return s.x = (i & 0x00FF'FFFF'FFFF'FFFF);
}

void
ME (M *m)
{
  FAP (&m->f, (F){ &m->c->i.b[m->c->i.s], 0 });
#define B(OP)                                                                 \
  --m->s.s;                                                                   \
  m->s.b[m->s.s - 1].n = m->s.b[m->s.s - 1].n OP m->s.b[m->s.s].n;            \
  ++m->i;
  while (m->i != m->c->i.b + m->c->i.s)
    {
      switch (*m->i >> 56)
        {
        case I0:
          ++m->i;
          break;
        case I1:
          --m->s.s;
          ++m->i;
          break;
        case I2:
          VAP (&m->s, (V){ .t = TN, .n = im (*m->i++) });
          break;
        case I3:
          VAP (&m->s, (V){ .t = TS, .s = m->c->d.b[im (*m->i++)] });
          break;
        case I4:
          VAP (&m->s, m->s.b[m->f.b[m->f.s - 1].b + im (*m->i++)]);
          break;
        case I5:
          m->s.b[m->s.s - 1].n += im (*m->i++);
          break;
        case I6:
          m->s.b[m->f.b[m->f.s - 1].b + im (*m->i++)] = m->s.b[m->s.s - 1];
          break;
        case I7:
          {
            size_t field_count = im (*m->i++);
            O *obj = malloc (sizeof (O) + field_count * sizeof (V));
            obj->c = field_count;
            obj->n = m->h;
            obj->m = true;
            m->h = obj;
            VAP (&m->s, (V){ .t = TO, .o = obj });
            break;
          }
        case I8:
          m->s.b[m->s.s - 1] = m->s.b[m->s.s - 1].o->f[im (*m->i++)];
          break;
        case I9:
          {
            V v = m->s.b[--m->s.s];
            m->s.b[m->s.s - 1].o->f[im (*m->i++)] = v;
            break;
          }
        case I10:
          if (m->s.b[--m->s.s].n == 0.0)
            {
              m->i += im (*m->i);
            }
          else
            {
              ++m->i;
            }
          break;
        case I11:
          if (m->s.b[--m->s.s].n != 0.0)
            {
              m->i += im (*m->i);
            }
          else
            {
              ++m->i;
            }
          break;
        case I12:
          m->i += im (*m->i);
          break;
        case I13:
          FAP (&m->f, (F){ m->i + 2, m->s.s - im (*m->i) });
          ++m->i;
          break;
        case I14:
          B (+);
          break;
        case I15:
          B (-);
          break;
        case I16:
          B (*);
          break;
        case I17:
          B (/);
          break;
        case I18:
          --m->s.s;
          m->s.b[m->s.s - 1].n = fmod (m->s.b[m->s.s - 1].n, m->s.b[m->s.s].n);
          ++m->i;
          break;
        case I19:
          B (==);
          break;
        case I20:
          {
            ++m->i;
            V v = m->s.b[--m->s.s];
            switch (v.t)
              {
              case TO:
                puts ("<object>");
                break;
              case TS:
                puts (v.s);
                break;
              case TN:
                printf ("%g\n", v.n);
                break;
              case TP:
                break;
              }
            break;
          }
        case I21:
          m->s.b[m->f.b[m->f.s - 1].b] = m->s.b[m->s.s - 1];
          m->s.s = m->f.b[m->f.s - 1].b + 1;
          m->i = m->f.b[m->f.s - 1].r;
          --m->f.s;
          break;
        }
    }
}

static uint64_t
RU (FILE *f)
{
  unsigned char b[8];
  fread (b, 1, 8, f);
  return (uint64_t)b[0] | (uint64_t)b[1] << 8 | (uint64_t)b[2] << 16
         | (uint64_t)b[3] << 24 | (uint64_t)b[4] << 32 | (uint64_t)b[5] << 40
         | (uint64_t)b[6] << 48 | (uint64_t)b[7] << 56;
}

static void
RD (S *b, FILE *f)
{
  b->s = 0;
  while (true)
    {
      char c = fgetc (f);
      if (c == EOF || c == '\0')
        break;
      SP (b, c);
    }
  SP (b, '\0');
}

void
LL (L *c, char const *path)
{
  FILE *f = fopen (path, "rb");
  uint64_t instr_count = RU (f);
  CR (&c->i, instr_count);
  for (size_t i = 0; i < instr_count; ++i)
    {
      CP (&c->i, RU (f));
    }
  uint64_t data_count = RU (f);
  DR (&c->d, data_count);
  S b;
  SI (&b);
  for (size_t i = 0; i < data_count; ++i)
    {
      RD (&b, f);
      char *d = malloc (b.s);
      memcpy (d, b.b, b.s);
      DP (&c->d, d);
    }
  SD (&b);
  fclose (f);
}

int
main (int argc, char **argv)
{
  if (argc < 2)
    {
      puts ("Usage: c8 <f.8o>");
      return 0;
    }

  L c;
  LI (&c);
  LL (&c, argv[1]);

  M m;
  MI (&m, &c);
  ME (&m);
  MD (&m);
}
fizzbuzz.8o data

entry #11

written by hyacinth
submitted at
1 like

guesses
comments 0

post a comment


fizzbuzz.groovy ASCII text, with CRLF line terminators
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
//and suddenly, he's caught in her embrace, her arms wrapping around him to draw him toward her.
//"sweetheart, you're my favorite person ever... i don't want to regret that."
//a marked sniffle delays her speech for a second, then, with her voice starting to crack, she continues,
//"please don't make me regret loving you."
//bringing her tail up to wrap around their intertwined bodies, she whispers through tears,
//"or at least wait to see your kids' faces before you ruin their lives."



for(i in 1..67)println((i%6?"":"Fizz")+(i%7?"":"Buzz")?:i)

entry #12

written by Makefile_dot_in
submitted at
0 likes

guesses
comments 0

post a comment


avid86 Unicode text, UTF-8 text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
\162\145\156\141\155\145 \162\145\156\141\155\145 umbenennen
umbenennen \151\146                 wenn
umbenennen \167\150\151\154\145     während
umbenennen \146\157\162             für
umbenennen \163\145\164             einstellen
umbenennen \151\156\143\162         erhöhen
umbenennen \163\167\151\164\143\150 wennist
umbenennen \160\162\157\143         prozedur
umbenennen \162\145\164\165\162\156 zurückliefern
umbenennen \145\162\162\157\162     fehler
umbenennen \141\160\160\145\156\144 anheften
umbenennen \160\165\164\163         drucken
umbenennen \145\170\160\162         ausrechnen

prozedur \164\143\154\72\72\155\141\164\150\146\165\156\143\72\72bool {x} {
    wennist $x {
        ja   - wahr   - 1 { zurückliefern 1 }
        nein - falsch - 0 { zurückliefern 0 }
    }

    fehler "nicht boolesch: $x"
}

einstellen i 0
während {bool("ja")} {
    erhöhen i
    einstellen x ""
    wenn {$i % 9  == 0} { anheften x Fizz }
    wenn {$i % 67 == 0} { anheften x Buzz }
    drucken [ausrechnen {$x == "" ? $i : $x}]
}