Skip to main content
Code Golf

Return to Question

Post Reopened by Dennis
edited tags
Link
Dennis Mod
  • 211.7k
  • 6
  • 95
  • 172
Post Closed as "Duplicate" by cat, Riker, Conor O'Brien, Community Bot
Tweeted twitter.com/StackCodeGolf/status/780163008144240640
Source Link
Conor O'Brien
  • 40.4k
  • 30
  • 30

On using multiple languages for a singular code golf submission

I was wondering if it were possible to use multiple languages in the same submission. Not a polyglot, but using each of the languages. I have two thoughts on this.

  1. One language invokes the other. Let's say we have a Ruby + JavaScript solution. Then, you could have, say, puts %x(node a) in run.rb and console.log(x=>x) in a, and have rub.rb be the main solution.
  2. Alternatively, each language could read the output of the previous language as input. E.g., invoke like <input> | <language a> | <langauge b>.

How would these be scored? How would it be consistent, concerning the usage of langs (e.g. multiple usages of the same lang)? How would it compare with each of its component languages? Should it be allowed at all? If not, why not?


Here is an example of a multi-language submission, using method 2:

J + Ruby, idk bytes

Ruby, ruby.rb:

p gets.split.map(&:to_i).map{|s|s+4}

J, j.ijs:

exit echo 1+i.10

Invoke like:

j.ijs | ruby.rb

Output:

[5, 6, 7, 8, 9, 10, 11, 12, 13, 14]

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