5
\$\begingroup\$
  1. Your program should take no input, and no network or other connections.
  2. Your program should output it's sourcecode.
  3. The sourcecode must consist of 3 types of characters: Numeric (0-9), Alpha (a-z|A-Z) and symbols !(0-9|a-z|A-Z). Constraints for the distribution of characters is:
    • 3.1. Every neighbouring characters with equal character-type makes a character-group.
    • 3.2. Each character-group length in bytes must be a prime-number (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, ...)
    • 3.3. The total number of character-groups of each character-type must be a neighbouring (but not equal) fibonacci sequence number. For example: 3 groups of numbers, 5 groups of alpha, 8 groups of symbols.
    • 3.4. A character-group of one charater-type cannot be adjacent to another character-group of the same character-type, because that will create one bigger group instead.

Example valid sourcecode (regarding character distribution, it does however not output it's sourcecode):

"."."."aa321'","/hithere' 12345678901,.,.,12345,.,

Character distribution in the example: 2 groups of Alpha. 3 group of numeric. 5 groups of other characters. The numbers 2, 3 and 5 are neighbouring numbers in the fibonacci sequence.

This is code-golf, good luck have fun!

\$\endgroup\$
  • \$\begingroup\$ You might want to disallow trivial solutions like any numeric literal in golfscript before it's too late. \$\endgroup\$ – John Dvorak Jan 18 '14 at 10:29
  • 1
    \$\begingroup\$ I believe the somewhat boring quine 12 would be legal in J, GolfScript, etc under these rules (2 being a prime number and 1 being a fibonacci number). \$\endgroup\$ – FireFly Jan 18 '14 at 10:29
  • \$\begingroup\$ The sourcecode must consist of all 3 types of characters, so it is atleast 6 character-groups \$\endgroup\$ – Plarsen Jan 18 '14 at 10:31
  • \$\begingroup\$ neighbours in the fibonacci sequence \$\endgroup\$ – Plarsen Jan 18 '14 at 10:33
  • \$\begingroup\$ so, 0 doesn't count as a fibonacci number? \$\endgroup\$ – John Dvorak Jan 18 '14 at 10:35
2
\$\begingroup\$

PHP, some other languages - 12 bytes

22ab,,22,,22

PHP will print out the source code if it is not wrapped in some tag.

This is actually the smallest possible answer to the question. The smallest prime number is 2, and the smallest distinct fibonacci numbers are 1, 2, and 3. 3 + 2 + 1 = 6. 6 * 2 = 12

See a run here: http://ideone.com/0NDA8A

\$\endgroup\$
3
\$\begingroup\$

Golfscript, 21 15 characters

11{'aa.~' }aa.~

After removing all NOPs, their images, and the leading 11, this becomes the quine

{`'.~'}.~

reading: block(string(dup, eval)); dup; eval.

Now to shoot for the stars (20 characters - the minimum for 2-3-5) or even galaxies (12 characters - the absolute minimum) I've taken a short stop at Alpha Centauri B to refuel, now I'm drifting through intergalactic medium. Thanks, Goldbach's conjecture.

Live: http://golfscript.apphb.com/?c=MTF7J2FhLn4nMTE7fWFhLn4K

\$\endgroup\$
  • \$\begingroup\$ @Plarsen shaved off six characters. One more to go, then I believe I'll hit the rock bottom for golfscript. \$\endgroup\$ – John Dvorak Jan 18 '14 at 13:48
  • \$\begingroup\$ oh man! I could never imagine that was even possible! \$\endgroup\$ – Plarsen Jan 18 '14 at 14:12
2
\$\begingroup\$

Befunge 98 - 16 bytes

<@,*+982aa,,kd$"

This works only if your interpreter interprets line-wrap as adding a single space. This one works otherwise:

<@,*+982aa,,kd "

Character groups:

<@,*+ 5 chars, symbols
982   3 chars, numbers
aa    2 chars, alpha
,,    2 chars, symbols
kd    2 chars, alpha
$"    2 chars, symbols

So the fibonacci numbers are 1 (numbers), 2 (alpha), and 3 (symbols)

\$\endgroup\$
2
\$\begingroup\$

Windows Command Script - 12 bytes (+ free folder bonus)

md  12##56##

Since every command is echoed by default, it's just a matter of finding the shortest command.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.