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 Answer

replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

Answer 120 - Rebmu

{//-##[][/]#i--#main(){println(
//sel/.*}}
p("Hello World!") 
;//"-##[;]#bye</>%"

Distance 7 from Answer 119 Answer 119

  • { and } are asymmetric string delimiters for an alternate representation of strings permitting balanced nested pairs, embedded quotes, etc. {Hey {it's} "legal"}. Add one at the beginning then two braces to create a balanced string after the .* cost 3

  • Standalone string literals not passed to any function are skipped by the evaluator, so that literal has no effect.

  • At the outset of the program, P is a single character abbreviation for PR, itself an abbreviation for PRINT. (If you wanted you could overwrite it and use as a variable in code golf and still access printing through PR, and if you overwrite that you could use PRINT. Or set X to point to the function value of P before you override it, etc.) cost 1

  • Parentheses are structural elements that can be used for arbitrary purposes (imagine if Lisp had [] and () as different "flavors" of series you could metaprogram with, with [] having the traditional "list" behavior). In the default evaluator parens just do precedence, so there's no significance to putting it around a string literal. Added a paren instead of subtracting in case it would be helpful, either way it's cost 1

  • Semicolon comments to end of line, get rid of last line using that with an insertion so that the comment comes after it. (Would have been 1 cheaper to do that with the first 2 lines but this is perhaps a better setup.) cost 1

  • Spend extra random character to join println onto main(){ cost 1

Answer 120 - Rebmu

{//-##[][/]#i--#main(){println(
//sel/.*}}
p("Hello World!") 
;//"-##[;]#bye</>%"

Distance 7 from Answer 119

  • { and } are asymmetric string delimiters for an alternate representation of strings permitting balanced nested pairs, embedded quotes, etc. {Hey {it's} "legal"}. Add one at the beginning then two braces to create a balanced string after the .* cost 3

  • Standalone string literals not passed to any function are skipped by the evaluator, so that literal has no effect.

  • At the outset of the program, P is a single character abbreviation for PR, itself an abbreviation for PRINT. (If you wanted you could overwrite it and use as a variable in code golf and still access printing through PR, and if you overwrite that you could use PRINT. Or set X to point to the function value of P before you override it, etc.) cost 1

  • Parentheses are structural elements that can be used for arbitrary purposes (imagine if Lisp had [] and () as different "flavors" of series you could metaprogram with, with [] having the traditional "list" behavior). In the default evaluator parens just do precedence, so there's no significance to putting it around a string literal. Added a paren instead of subtracting in case it would be helpful, either way it's cost 1

  • Semicolon comments to end of line, get rid of last line using that with an insertion so that the comment comes after it. (Would have been 1 cheaper to do that with the first 2 lines but this is perhaps a better setup.) cost 1

  • Spend extra random character to join println onto main(){ cost 1

Answer 120 - Rebmu

{//-##[][/]#i--#main(){println(
//sel/.*}}
p("Hello World!") 
;//"-##[;]#bye</>%"

Distance 7 from Answer 119

  • { and } are asymmetric string delimiters for an alternate representation of strings permitting balanced nested pairs, embedded quotes, etc. {Hey {it's} "legal"}. Add one at the beginning then two braces to create a balanced string after the .* cost 3

  • Standalone string literals not passed to any function are skipped by the evaluator, so that literal has no effect.

  • At the outset of the program, P is a single character abbreviation for PR, itself an abbreviation for PRINT. (If you wanted you could overwrite it and use as a variable in code golf and still access printing through PR, and if you overwrite that you could use PRINT. Or set X to point to the function value of P before you override it, etc.) cost 1

  • Parentheses are structural elements that can be used for arbitrary purposes (imagine if Lisp had [] and () as different "flavors" of series you could metaprogram with, with [] having the traditional "list" behavior). In the default evaluator parens just do precedence, so there's no significance to putting it around a string literal. Added a paren instead of subtracting in case it would be helpful, either way it's cost 1

  • Semicolon comments to end of line, get rid of last line using that with an insertion so that the comment comes after it. (Would have been 1 cheaper to do that with the first 2 lines but this is perhaps a better setup.) cost 1

  • Spend extra random character to join println onto main(){ cost 1

Source Link

Answer 120 - Rebmu

{//-##[][/]#i--#main(){println(
//sel/.*}}
p("Hello World!") 
;//"-##[;]#bye</>%"

Distance 7 from Answer 119

  • { and } are asymmetric string delimiters for an alternate representation of strings permitting balanced nested pairs, embedded quotes, etc. {Hey {it's} "legal"}. Add one at the beginning then two braces to create a balanced string after the .* cost 3

  • Standalone string literals not passed to any function are skipped by the evaluator, so that literal has no effect.

  • At the outset of the program, P is a single character abbreviation for PR, itself an abbreviation for PRINT. (If you wanted you could overwrite it and use as a variable in code golf and still access printing through PR, and if you overwrite that you could use PRINT. Or set X to point to the function value of P before you override it, etc.) cost 1

  • Parentheses are structural elements that can be used for arbitrary purposes (imagine if Lisp had [] and () as different "flavors" of series you could metaprogram with, with [] having the traditional "list" behavior). In the default evaluator parens just do precedence, so there's no significance to putting it around a string literal. Added a paren instead of subtracting in case it would be helpful, either way it's cost 1

  • Semicolon comments to end of line, get rid of last line using that with an insertion so that the comment comes after it. (Would have been 1 cheaper to do that with the first 2 lines but this is perhaps a better setup.) cost 1

  • Spend extra random character to join println onto main(){ cost 1

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