Code Golf: Code Golf: Difference between revisions

Content added Content deleted
Line 439: Line 439:
Or, in case binary literals are allowed, the program is 51 bytes long.
Or, in case binary literals are allowed, the program is 51 bytes long.
<syntaxhighlight lang="rebol">s: enbase #{1A875E1A895F}insert at s 5 space prin s</syntaxhighlight>
<syntaxhighlight lang="rebol">s: enbase #{1A875E1A895F}insert at s 5 space prin s</syntaxhighlight>

=={{header|RPL}}==
≪ "Code Golf" ≫
The above code costs 48 nibbles (e.g. 4 bits) of memory (e.g. 24 bytes); the string itself requires 28 quartets.
≪ #102d #108d #111d #71d #32d #101d #100d #111d 67 CHR 1 8 START SWAP B→R CHR + NEXT ≫
This string-free code costs 221 nibbles (111 bytes). Unsigned integers - numbers starting with a <code>#</code> - have been used whenever possible since they use 10 nibbles less than floating-point numbers to store a value up to #FFFFF


=={{header|Ruby}}==
=={{header|Ruby}}==
Line 446: Line 452:
# Taken from Perl:
# Taken from Perl:
$><<['436F646520476F6C66'].pack('H*') #37 chars</syntaxhighlight>
$><<['436F646520476F6C66'].pack('H*') #37 chars</syntaxhighlight>

=={{header|Run BASIC}}==
=={{header|Run BASIC}}==
With a quoted string, the following weighs in at 17 bytes.
With a quoted string, the following weighs in at 17 bytes.