Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Revisions

11 of 11
Commonmark migration

SmileBASIC, (削除) 9 (削除ここまで) 7 bytes per line, (削除) 159 (削除ここまで) (削除) 155 (削除ここまで) (削除) 154 (削除ここまで) 152 bytes

This was a really fun challenge. Unfortunately, the rule against unnecessary line breaks causes a few problems, (though luckily it doesn't affect the maximum line length here.) I had to add comments between lines like A%=I/3 and A=A%*3, since A%=I/3A=A%*3 is parsed correctly in SB. I was able to use a trick to leave out some comments, since replacing A with E makes that line invalid (It has something to do with numbers written using E notation, I think. 3E is considered an invalid number rather than a number and a variable name.)

A$="App
B$="le
P$="Pie
INPUT N
R=N
WHILE R
INC I
R=I<N
A%=I/3'
A=A%*3'
A=A==I
B%=I/5
E=B%*5
E=E==I'
?A$*A;
?B$*E;
?P$*E;
C=A+E
WHILE!C
C=1?I;
WEND?
WEND

The biggest limitation here is getting input. INPUT x is the simplest way allowed, the alternative being to define a function with an input value like DEF F x but that is still 7 characters. Making a conditional statement is also hard; I can't think of anything shorter than WHILE x.

12Me21
  • 6.8k
  • 1
  • 23
  • 40

AltStyle によって変換されたページ (->オリジナル) /