タグ付けされた質問 「polyglot」

複数のプログラミング言語で実行されるコードに関連する課題。

30
int入力nを指定して、n * reversed(n)を出力します
整数nを指定して出力n * reversed(n) reversed(n)は、reverseの桁を取得したときに取得する数値ですn。 reverse(512) = 215 reverse(1) = 1 reverse(101) = 101 >>>>>>>> func(5) = 5*5 = 25 func(12) = 12*21 = 252 func(11) = 11*11 = 121 func(659) = 659*956 = 630004 最短のコードが勝ちます! リーダーボード コードスニペットを表示 var QUESTION_ID=144816,OVERRIDE_USER=71625;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="<h1>"+e.body.replace(OVERRIDE_REG,"")+"</h1>")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var …
9 code-golf  math  arithmetic  code-golf  math  integer  code-golf  arithmetic  integer  code-golf  sequence  base-conversion  palindrome  code-golf  math  primes  integer  code-golf  parsing  conversion  syntax  code-golf  sequence  primes  code-challenge  geometry  optimization  code-golf  graph-theory  code-golf  number-theory  primes  integer  code-golf  source-layout  cops-and-robbers  code-golf  source-layout  cops-and-robbers  code-golf  sequence  primes  integer  code-golf  math  number-theory  primes  rational-numbers  code-golf  math  sequence  number-theory  primes  code-golf  string  code-golf  math  combinatorics  permutations  restricted-complexity  code-golf  array-manipulation  code-golf  number  sequence  code-golf  number  sequence  code-golf  binary-matrix  code-golf  math  tips  javascript  algorithm  code-golf  string  code-golf  number  sequence  code-golf  math  arithmetic  parsing  code-golf  number  sequence  primes  code-golf  string  ascii-art  geometry  integer  code-golf  geometry  code-golf  number  array-manipulation  code-golf  math  geometry  code-golf  number  sequence  arithmetic  integer  code-golf  string  kolmogorov-complexity  code-golf  number  code-golf  number  chess  code-golf  sequence  decision-problem  subsequence  code-golf  math  number  primes  code-golf  primes  permutations  code-golf  integer  probability-theory  statistics  code-golf  string  code-golf  sequence  decision-problem  parsing  board-game  code-golf  binary  graph-theory  code-golf  board-game  classification  tic-tac-toe  code-golf  ascii-art  polyglot  code-golf  date  code-golf  geometry 

6
ポリグロットクインを後方に転送します。
あなたは一つの言語でそのソースコードとソースコードを出力ポリグロットしなければならない後方別では。通常のルールとは異なり、現在のファイルを読み取るか、組み込みを使用して提出物のソースコードを取得し、1つの言語でそれを逆にすることができます。ソースコードを回文にすることはできません。 たとえば、ソースコードがの場合、ある言語と別の言語でabcxyz出力する必要があります。コードがの場合、回文であるため無効です。abcxyzzyxcbaabcxyzyxbca 幸運を!

5
木の生と死
チャレンジ 整数Nを入力として受け取り、ツリーが現在存在する生死の段階を出力するプログラムを作成します。Nは常に0から10の間です。 生と死の段階 人生:人生のステージを描くには、単純に文字で構成されるサイズNのベースを描き、結果が0より大きい場合は上に^移動してNから2 を引き^、もう一度サイズを変えて文字の線を描きます。新しいのN。Nが0より大きい間繰り返します。終了するには|、Nの開始値が奇数の場合は1 文字、偶数の||場合は2 文字を配置します。 例:N = 5 ^ ^^^ ^^^^^ | N = 0の場合、葉(^)なしで茎のみが描画されることに注意してください。 死:これは大体同じである生活基盤であることを除いて、- N 10、あなたが使用Mするのではなく^、あなたがに2を追加Nと、上記と同じ手順で行を再描画が、今回は、あなたがに2を追加Nことながら、は10以下です。 例:N = 3 M MMM MMMMM MMMMMMM | 目標 プログラムは2つの異なる言語で実行する必要があり、どちらも入力Nを受け取る必要があります。最初の言語はNに従って木のライフステージを出力する必要があり、2番目の言語は死のステージを出力する必要があります。 ルール これはcode-golfであり、すべての要件を満たすバイト単位の最短のコードです。 コードは2つの異なる言語で実行する必要があります。はい、Python 2とPython 3 は異なる言語です。 標準の抜け穴は禁止されています。 末尾の改行またはスペースは許可されます。 テストケース 入力: N = 1 第一言語(生活): ^ | 第二言語(死): M MMM MMMMM …
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.