Code Golf: Code Golf: Difference between revisions

m
→‎{{header|Phix}}: use pygments, added program name version
(Add Uxntal)
m (→‎{{header|Phix}}: use pygments, added program name version)
Line 499:
 
=={{header|Phix}}==
<!--<syntaxhighlight lang="Phix">(phixonline)-->
<!--</syntaxhighlight>-- lang="Phix">
<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: #008000;">"Code Golf"</span><span style="color: #0000FF;">)</span>
puts(1,"Code Golf")
<!--</syntaxhighlight>-->
</syntaxhighlight>
Which is 19 bytes. Note that <code>?"Code Golf"</code>, while only 12 bytes, ''does'' print the quotation marks and therefore does not meet the task specifications.<br>
Without using string literals, at 42 bytes we can have
<!--<syntaxhighlight lang="Phix">(phixonline)-->
puts(1,{67,111,100,101,32,71,111,108,102})
<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;">67</span><span style="color: #0000FF;">,</span><span style="color: #000000;">111</span><span style="color: #0000FF;">,</span><span style="color: #000000;">100</span><span style="color: #0000FF;">,</span><span style="color: #000000;">101</span><span style="color: #0000FF;">,</span><span style="color: #000000;">32</span><span style="color: #0000FF;">,</span><span style="color: #000000;">71</span><span style="color: #0000FF;">,</span><span style="color: #000000;">111</span><span style="color: #0000FF;">,</span><span style="color: #000000;">108</span><span style="color: #0000FF;">,</span><span style="color: #000000;">102</span><span style="color: #0000FF;">})</span>
<!--</syntaxhighlight>-->
Slightly shorter, at 30 bytes, though it could be considered string/char:
<!--<syntaxhighlight lang="Phix">(phixonline)-->
puts(1,x"436F646520476F6C66")
<span style="color: #7060A8;">puts</span><span style="color: #0000FF;">(</span><span style="color: #000000;">1</span><span style="color: #0000FF;">,</span>x"<span style="color: #0000FF;">436F646520476F6C66</span>"<span style="color: #0000FF;">)</span>
<!--</syntaxhighlight>-->
The compiled size of the first is 276,992 bytes.
You can actually make a smaller executable as follows:
<!--<syntaxhighlight lang="Phix">(phixonline)-->
include puts1h.e
<span style="color: #008080;">include</span> <span style="color: #000000;">puts1h</span><span style="color: #0000FF;">.</span><span style="color: #000000;">e</span>
puts1("Code Golf")
<span style="color: #000000;">puts1</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"Code Golf"</span><span style="color: #0000FF;">)</span>
<!--</syntaxhighlight>-->
Then compile it with p -c -nodiag ''test.exw'' (or whatever) to yield an executable of 36,532 bytes -
no diagnostics, which is itself non-trivial and otherwise pulls in file handling (for the ex.err it writes),
Line 525 ⟶ 526:
Oh, I should also say the compiler/interpreter/linker/debugger is itself (currently) 2,789,376 bytes, plus you'll still need most of builtins/ which is around the 9MB mark.
 
While not exactly shorter, if you name the source code as Code Golf[.exw] or the executable as Code Golf[.exe], perhaps needing a substitute(s,'_',' '), this approach will also work:
<syntaxhighlight lang="Phix">
puts(1,get_file_base(command_line()[2]))
</syntaxhighlight>
 
=={{header|Phixmonti}}==
7,795

edits