0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

はじめに

この記事は 共通テスト手順記述標準言語 (DNCL) Advent Calendar 2025 の8日目の記事です。

よくある共テ関係でもよく見る、連想配列の添え字を使って対応する値を表示させるのをやります。

モールスに変換しよう

morseという連想配列は添え字が文字、対応する値がモールス符号とします。例えばmorse[a]".-"に対応しています。
また、単語間には_を使っています。

morse ← {"a":".-","b":"-...","c":"-.-.","d":"-..","e":".","f":"..-.","g":"--.","h":"....","i":"..","j":".---","k":"-.-","l":".-..","m":"--","n":"-.","o":"---","p":".--.","q":"--.-","r":".-.","s":"...","t":"-","u":"..-","v":"...-","w":".--","x":"-..-","y":"-.--","z":"--..","0":"-----","1":".----","2":"..---","3":"...--","4":"....-","5":".....","6":"-....","7":"--...","8":"---..","9":"----."}
bunsyo ← "i_like_dncl"
mozisu ← 11
i を1から mozisu まで1ずつ増やしながら
|  もし bunsyo[i] == "_" ならば
|  |  「    」を表示する
|  を実行し、そうでないならば
|  |  morse[bunsyo[i]]を表示する
|  を実行する
|  「   」を表示する
実行する
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?