周期文字列、隠しプログラム


13

次のタスクを実行する3つのプログラムを作成します。

これら3つのプログラムのソースコードをA、B、Cとしましょう。

  • AがBCを出力として生成する場合、
  • BがCAを実行している場合、
  • CがABを実行する場合。

そのため、各プログラムは文字列(各プログラムで循環)を書き込み、それ自体を隠します。

追加ですが必須の制約:

  • 標準的な抜け穴は禁止されています。
  • 各プログラムは少なくとも1バイトの長さが必要です。
  • 3つのプログラムそれぞれ異なる言語で作成する必要あります。

あなたの提出物がこの形式を持っているといいでしょう:

言語A(Aのサイズ)-言語B(Bのサイズ)-言語C(Cのサイズ)-スコア

A B C
<extra stuff>

勝者は、3つのプログラムのサイズの合計である最小スコアを獲得した人です。


(リーダーボードスクリプトに合わせて)スコアが最後に来る方がいいでしょう
リーキーヌン


7
締め切りはお勧めしません。
エリックアウトゴルファー

についての要件ABおよびC異なる文字列であること?たとえば、3つの文字列を同じにすることはできますか?プログラムが出力の後に改行を出力する場合、それをカウントできませんか?
ルイスメンドー

これは必須ではありませんABC異なっています。改行は出力の一部としてカウントされるため、文字列内の改行はプログラムの一部です。
Blex

回答:


3

Befunge-98Gol> <>およびWumpus 47 * 3 = 141バイト

"r75*1-47*0.@o&r84#o&]=74#]=\`/KHj '!_@#,k.'g00

Befungeでお試しください! > <>で試してみてください! Wumpusでお試しください!

そうです、同じプログラムが3回以上です!上記の言語のいずれかで実行すると、ソースコードが2回出力されます。これは、他の2つのプログラムが連結されたものです。

使い方:

Befunge code:
  "r                               j '!_@#,k.'g00

  "   Wrapping string literal over code
   r  Reflect the pointer
  "   Wrapping string literal
                                              g00   Fetch " from cell 0,0 
                                          ,k.'      Print 47 characters
                                       _@#          If the next character is 0, exit
                                      !             Otherwise, set it to 0
                                   j '              And jump back to the beginning


Gol><> code:
  "r75*1-47*0.                \`/KH

  "             Wrapping string literal
   r            Reverse stack
    75*1-       Push "
         47*0.  Jump to cell 28,0
                              \  Continue right
                               `/K   Duplicate the top 47 characters on the stack
                                  H  Halt and output stack contents

Wumpus code:
  "r75*1-47*0.@o&r84#o&]=74#]=\

  "r75*1-47*0.  Exact same function as the ><> code, but with a bouncing string literal
                              \  Reflect left
                            ]=   Push a copy of the " to the bottom of the stack
                         74#     Push 47
                       ]=        Push a copy of the 47 to the bottom of the stack
                     o&          Print the top 47 characters
                  84#            Push a '0' to make up for the missing 0 at the end
               o&r               Reverse the stack and print the top 47 characters
              @                  And terminate

0

JScript、VBScript、Windows Batch、345バイト

a=new ActiveXObject("scripting.filesystemobject");b=a.opentextfile(".js");c=b.readline();d=b.readline();a.createtextfile(".bat").write("@echo "+d.substr(2)+">.vbs\n@echo '"+c+">>.vbs")
//set a=createobject("scripting.filesystemobject"):set b=a.opentextfile(".vbs"):c=b.readline:d=b.readline:a.createtextfile(".js").write(mid(d,2)+chr(10)+"//"+c)

ファイルに.jsという名前を付けてから、.vbs、.batの順に作成します。

弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.