ユーザ用ツール

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
いろんな言語でハノイの塔 [2025/06/03 05:49] – [awk] arakiいろんな言語でハノイの塔 [2025/06/03 05:51] (現在) – [Batch (Cmd.exe)] araki
行 131: 行 131:
 これを回避するために'':NORMALIZE''という関数を用意して、文字列''08''および''09''は、数値に置きかえるように処理している。 これを回避するために'':NORMALIZE''という関数を用意して、文字列''08''および''09''は、数値に置きかえるように処理している。
  
-<code hanoi.bat>+<code dos>
 @echo off @echo off
  
行 206: 行 206:
 === 実行結果 === === 実行結果 ===
 PowerShell版と同じ環境で実行したが、恐ろしく遅い。 PowerShell版と同じ環境で実行したが、恐ろしく遅い。
-<code command>+<code dos>
 C:\Users\araki\Documents>Hanoi -n 4 C:\Users\araki\Documents>Hanoi -n 4
 Disc 1 moved from 1 to 3 Disc 1 moved from 1 to 3
行 651: 行 651:
 コードにはコメントをつけてあります。 コードにはコメントをつけてあります。
 引数はなんとなくそんな感じになるように処理していますが、適当なので、あまり追求しないでください。 引数はなんとなくそんな感じになるように処理していますが、適当なので、あまり追求しないでください。
-<code bas>+<code rtl>
 #!/usr/bin/env rvtlw #!/usr/bin/env rvtlw
 1000 !=^GETARG       : Set Number of Discs 1000 !=^GETARG       : Set Number of Discs
行 1098: 行 1098:
 コマンドラインの引数をとるために flagを、表示の加工用に fmtモジュールを利用している以外は、コード内で完結している。 コマンドラインの引数をとるために flagを、表示の加工用に fmtモジュールを利用している以外は、コード内で完結している。
  
-<code>+<code go>
 package main package main
  
行 1145: 行 1145:
 === 実行結果 === === 実行結果 ===
  
-<code>+<code bash>
 araki@cherry:~/work/Hanoi$ time ./hanoigo -n 4 araki@cherry:~/work/Hanoi$ time ./hanoigo -n 4
 Disc 1 moved from 1 to 3. Disc 1 moved from 1 to 3.
行 1181: 行 1181:
 また、ガベージコレクションによる動的なメモリ管理ではなく、静的な管理が中心となる。 また、ガベージコレクションによる動的なメモリ管理ではなく、静的な管理が中心となる。
  
-<code>+<code rust>
 use getopts::Options; use getopts::Options;
 use std::process; use std::process;
行 1230: 行 1230:
 </code> </code>
 === 実行結果 === === 実行結果 ===
-<code>+<code bash>
 araki@cherry:~/work/Hanoi/hanoi$ time target/debug/hanoi -n 4 araki@cherry:~/work/Hanoi/hanoi$ time target/debug/hanoi -n 4
 Disc 1 moved from 1 to 3 Disc 1 moved from 1 to 3

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also, you acknowledge that you have read and understand our Privacy Policy. If you do not agree, please leave the website.

More information