From be023679f87c8b5aa7b69734ec82e00cd32f3c84 Mon Sep 17 00:00:00 2001 From: "smalruby3-editor-bot[bot]" <297607354+smalruby3-editor-bot[bot]@users.noreply.github.com> Date: Sun, 29 Nov 2026 00:11:09 +0000 Subject: [PATCH 1/4] feat(dncl): treat the say and ask blocks as unsupported in the japanese tab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 表示する and 【外部からの入力】 now mean only the console. The say block (say/puts/print/p) and ask and wait with answer of the stage are told as unsupported commands with a message that names the console block, and the blocks are not changed. The Japanese mode palette hides the looks and sensing categories. Closes #2623 Co-Authored-By: Claude Opus 5.5 --- docs/dncl/README.md | 26 +- docs/dncl/design.md | 3 + docs/smalruby-dncl-spec.ja.md | 10 +- .../scratch-gui/src/containers/ruby-tab.jsx | 16 + .../src/lib/dncl/dncl-block-filter.js | 10 +- .../scratch-gui/src/lib/dncl/dncl-keywords.js | 8 +- .../src/lib/dncl/dncl-validator.js | 39 +- .../src/lib/dncl/ja-notation-table.js | 62 +- .../scratch-gui/src/lib/genai-dncl-prompt.js | 2 +- packages/scratch-gui/src/locales/en.js | 4 + packages/scratch-gui/src/locales/ja-Hira.js | 4 + packages/scratch-gui/src/locales/ja.js | 4 + .../test/fixtures/ja-notation/golden/ja.json | 7 + .../fixtures/ja-notation/golden/ruby.json | 4129 +++++++++++++---- .../dncl-bare-method-in-expression.test.js | 27 +- .../unit/lib/dncl/dncl-block-filter.test.js | 15 +- .../lib/dncl/dncl-display-multi-arg.test.js | 15 +- .../test/unit/lib/dncl/dncl-do-block.test.js | 4 +- .../lib/dncl/dncl-number-notation.test.js | 8 +- .../unit/lib/dncl/dncl-post-test-loop.test.js | 12 +- .../test/unit/lib/dncl/dncl-roundtrip.test.js | 12 +- .../lib/dncl/dncl-say-block-roundtrip.test.js | 124 +- .../unit/lib/dncl/dncl-stage-variable.test.js | 7 +- .../lib/dncl/dncl-trailing-comment.test.js | 1 - .../lib/dncl/dncl-unsupported-command.test.js | 2 +- .../unit/lib/dncl/dncl-validation.test.js | 12 +- .../test/unit/lib/dncl/ruby-to-dncl.test.js | 80 +- .../make-toolbox-xml-dncl-extensions.test.js | 15 + .../lib/ruby-roundtrip/japanese-table.test.js | 22 - 29 files changed, 3477 insertions(+), 1203 deletions(-) diff --git a/docs/dncl/README.md b/docs/dncl/README.md index bae6c091399..25b5c12e717 100644 --- a/docs/dncl/README.md +++ b/docs/dncl/README.md @@ -168,7 +168,7 @@ | ファイル | 役割 | |---|---| | `dncl-to-ruby.js` | 日本語 → Ruby 変換のエントリポイント(`dnclToRuby`)。ja-notation(下の「日本語 → Ruby の変換(ja-notation)」)で読んで Ruby と行の対応を作り、誤りを `ja-notation-errors.js` で日本語モードの文言にする | -| `ja-notation-table.js` | ja-notation に渡すスモウルビーの表(`表示する` → `console.puts`、大文字の名前 → `@_var_X_` / `@_array_X_`、入力 → `console.gets` など。`console` はコンソールの拡張機能のブロック)と、その逆向きの表(`SMALRUBY_RUBY_TO_JA`: `console.puts` / `puts` / `say` / `p` / `print` → `表示する`、`.to_i` → `整数` など、`@_array_X_` → `X`、`console.gets` の代入と、`ask("")` と次の行の `answer` → 入力)。組み込み関数の一覧 `DNCL_BUILTIN_NAMES`(生成AI に相談の質問文の命令の例にも使う) | +| `ja-notation-table.js` | ja-notation に渡すスモウルビーの表(`表示する` → `console.puts`、大文字の名前 → `@_var_X_` / `@_array_X_`、入力 → `console.gets` など。`console` はコンソールの拡張機能のブロック)と、その逆向きの表(`SMALRUBY_RUBY_TO_JA`: `console.puts` → `表示する`、`.to_i` → `整数` など、`@_array_X_` → `X`、`console.gets` の代入 → 入力。「言う」の `say` / `puts` / `p` / `print` と「聞いて待つ」の `ask` / `answer` は持たない)。組み込み関数の一覧 `DNCL_BUILTIN_NAMES`(生成AI に相談の質問文の命令の例にも使う) | | `ja-notation-errors.js` | **ja-notation の誤りを、日本語モードで見せる文言にする対応表**(日本語 → Ruby の `jaNotationErrors`、Ruby → 日本語の `rubyErrorWords`)。下の「誤りの文言」 | | `dncl-indent.js` | **字下げの幅の数え方**(`indentWidth`: タブは 4 桁・全角空白は 2 桁、`indentOffset`: ある幅の位置の字下げの文字)。読むモードが使う(ja-notation の読み方も同じ数え方) | | `dncl-problem-form.js` | **読むモードの配置**(`layoutProblemForm`: 行ごとの行番号 `(01)` と罫線の位置・種類、`problemFormText`: 行番号と罫線を文字で付けた形)。エディタの描画(`dncl-problem-form-view.js`)と「行番号と罫線つきでコピー」が使う | @@ -459,22 +459,22 @@ Smalruby のルビータブ(Ruby / ふりがな)と日本語タブ(DNCL) | **DNCL** `x = 【外部からの入力】` → Ruby / Block | `@x = console.gets` / `x を (入力する) にする` | `【整数を入力】` は `console.gets.to_i` / `整数を入力する`(全角の数字も数として読む) | | Block `smalrubyConsole_print` / `smalrubyConsole_input` / `smalrubyConsole_inputInteger` → **DNCL** | `表示する(...)` / `【外部からの入力】` / `【整数を入力】` | 前の作品の `((入力する) の切り捨て)` も `【整数を入力】` | | Block `looks_sayforsecs(msg, n)` → **Ruby** | `say(msg, n)` | 秒数を保持 | -| Block `looks_sayforsecs(msg, n)`(Ruby の `puts` / `say`)→ **DNCL** | `表示する(msg)` | **秒数 n は無視**。もう一度日本語から変換すると、コンソールのブロックになる | -| Block `sensing_askandwait("")` + 次の `答え` の代入 → **DNCL** | `【外部からの入力】` | コンソールの前の日本語のプログラム。もう一度日本語から変換すると、コンソールのブロックになる | +| Block「言う」(Ruby の `say` / `puts` / `print` / `p`)→ **DNCL** | 誤り | 日本語タブでは使えないブロック。ルビータブのその行に「「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。」を出す | +| Block「聞いて待つ」「答え」(Ruby の `ask` / `answer`)→ **DNCL** | 誤り | 同じく「「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。」 | -### 不可逆な変換とその理由 +### 「言う」「聞いて待つ」を日本語にしない理由 -#### 1. Block `say(msg, n)` → DNCL `表示する(msg)` (秒数喪失) +**理由**: 日本語の `表示する` はキャラクターの吹き出しではなく、コンソールへの出力を意味します。「言う」も `表示する` と書くと、 +同じ `表示する(...)` が「ステージの吹き出し」と「コンソール」の 2 つの意味を持ち、生徒が混乱します(日本語タブではステージが +コンソールに隠れているので、「言う」は出ないように見える)。`【外部からの入力】` と「聞いて待つ」「答え」も同じです。 +また、日本語タブで書き直すと「言う」がコンソールのブロックに変わり、人間が作ったブロックのプログラムを黙って変えてしまいます。 -**理由**: 日本語の `表示する` は「コンソールに値を表示する」という操作で、秒数 (Scratch の吹き出し表示時間) は概念として持っていません。 +**結果**: 日本語モードでは見た目と調べるのカテゴリは使えません。コードタブのパレットにも出しません(`dncl-block-filter.js`)。 +「言う」「聞いて待つ」「答え」を使ったプログラムで日本語タブを開くと、`move(10)` などと同じ「日本語にできない命令」として、 +ルビータブのその行に、代わりに使うコンソールのブロックを書いた誤りを出します。ブロックは変えません。 +日本語タブの中に誤りの行として出す形にはしない(読めない行があると、タブの移動と旗が止まり、生徒が抜け出せなくなるため)。 +日本語タブに `say(...)` などと書いたときも、同じ文を出します。 -**結果**: Block で秒数を 2 にしても DNCL では `表示する(msg)` (秒数情報なし) になります。 - -#### 2. DNCL `表示する` → コンソールのブロック(`say` / `puts` には戻さない) - -**理由**: 日本語の `表示する` はキャラクターの吹き出しではなく、コンソールへの出力を意味します。`say` は Scratch の吹き出し演出を含むため、日本語の「表示」とは概念的に異なります。 - -**結果**: 「言う」のブロック(Ruby の `say` / `puts`)や「聞いて待つ」と「答え」で作ったプログラムを日本語タブで編集すると、**コンソールのブロックに変わったまま戻らない**。秒数情報も失われます。 Ruby の `puts` / `gets` は、いままでどおりコンソールのブロックにはしません(ルビータブは Scratch の部分集合。`design.md` の 5 章)。 ### ブロックを通ったときの並び diff --git a/docs/dncl/design.md b/docs/dncl/design.md index 61f0bec3afe..66c33fea599 100644 --- a/docs/dncl/design.md +++ b/docs/dncl/design.md @@ -153,6 +153,9 @@ Ruby や日本語のプログラムの `表示する` は、キャラクター - 画面: **ステージの上にコンソールボタン**を置き、押すとステージがコンソールに切りかわる。 - 日本語のプログラムではキャラクターをそもそも動かさないので、日本語タブではステージがコンソールになるのが最善。 - 「聞いて待つ」もコンソールの入力として振る舞う。 +- 日本語タブでは「言う」「聞いて待つ」「答え」を使えない(見た目と調べるのカテゴリをパレットに出さない)。 + `表示する` と `【外部からの入力】` はコンソールだけの意味にして、同じ言葉が 2 つの意味を持たないようにする。 + それを使ったプログラムは、日本語にせずにルビータブの行に誤りを出す(ブロックは変えない。[README](./README.md) の変換マトリクス)。 - **コンソールでのやりとりを主にするのは日本語タブだけ**。Ruby の `puts` / `gets` はコンソールのブロックに対応させない。 Ruby タブは Scratch の部分集合(Scratch でできることを Ruby で書く)なので、コンソールのブロックを Ruby で書く形は足さない。 - 将来の案: Ruby タブに「コンソールモード」のような切りかえを置き、そのときだけ `puts` / `gets` がコンソールを使う。いまは作らない。 diff --git a/docs/smalruby-dncl-spec.ja.md b/docs/smalruby-dncl-spec.ja.md index 3b7e1067718..379c9f10fb7 100644 --- a/docs/smalruby-dncl-spec.ja.md +++ b/docs/smalruby-dncl-spec.ja.md @@ -478,7 +478,7 @@ DNCL 風の形の `返す 式` も読みます。 表示する(not x, y) # → console.puts((!@x).to_s + @y.to_s) ``` -> **重要 (不可逆性)**: `表示する(...)` と `【外部からの入力】` は、**コンソールの拡張機能**のブロック([`docs/extension-smalruby-console/`](extension-smalruby-console/README.md))になり、Ruby では `console.puts(...)` / `console.gets` と書きます(「言う」`say` / `puts` や「聞いて待つ」ではない)。`表示する` はキャラクターの吹き出しではなくコンソールへの出力だからです。「言う」や「聞いて待つ」で作ったプログラムも `表示する` / `【外部からの入力】` として読みますが、日本語から変換し直すとコンソールのブロックになります。ステージの上のコンソールのボタンで、ステージとコンソールを切りかえます。詳細は [Block ↔ Ruby ↔ DNCL 変換マトリクス](dncl/README.md#block--ruby--dncl-の変換マトリクス) を参照。 +> **重要 (不可逆性)**: `表示する(...)` と `【外部からの入力】` は、**コンソールの拡張機能**のブロック([`docs/extension-smalruby-console/`](extension-smalruby-console/README.md))になり、Ruby では `console.puts(...)` / `console.gets` と書きます(「言う」`say` / `puts` や「聞いて待つ」ではない)。`表示する` はキャラクターの吹き出しではなくコンソールへの出力だからです。「言う」「聞いて待つ」「答え」は日本語タブでは使えないブロックで、それを使ったプログラムを日本語タブで開くと、ルビータブのその行に誤り(コンソールのブロックを使うように)を出します(ブロックは変えません)。ステージの上のコンソールのボタンで、ステージとコンソールを切りかえます。詳細は [Block ↔ Ruby ↔ DNCL 変換マトリクス](dncl/README.md#block--ruby--dncl-の変換マトリクス) を参照。 `【外部からの入力】` / `【整数を入力】` は代入文の右辺で使用します: @@ -581,8 +581,10 @@ kamoku を 1 から 3 まで 1 ずつ増やしながら繰り返す: ### 完全に非表示のカテゴリ - **動き(Motion)** — 非表示 +- **見た目(Looks)** — 非表示(「言う」も使えない。表示はコンソールの `〜を表示する`) - **音(Sound)** — 非表示 - **イベント(Events)** — 非表示(共通テスト用プログラム表記にはイベント概念がない) +- **調べる(Sensing)** — 非表示(「聞いて待つ」「答え」も使えない。入力はコンソールの `入力する`) ### 使用可能なブロック @@ -591,8 +593,6 @@ kamoku を 1 から 3 まで 1 ずつ増やしながら繰り返す: | **制御** | `〜回繰り返す`, `もし〜なら`, `もし〜でなければ`, `〜まで繰り返す` | 増やしながら繰り返す, もし, もし〜そうでなければ, 〜の間繰り返す | | **演算** | すべて | 算術・比較・論理演算子 | | **コンソール** | `〜を表示する`, `入力する` | `表示する()`, `【外部からの入力】` | -| **見た目** | `〜と〜秒言う`(`say for N secs`)のみ | `表示する()`(読むだけ) | -| **調べる** | `〜と聞いて待つ`(`ask`), `答え`(`answer`)のみ | `【外部からの入力】`(読むだけ) | | **変数** | すべて(変数の作成、代入、変化、表示/非表示) | 変数代入 | | **リスト** | すべて(追加、削除、挿入、置換、取得、検索、長さ、含む、空判定) | 配列操作(`A に 値 を追加する` など) | | **ブロック定義** | すべて(関数定義、関数呼び出し、引数) | `関数 名前(引数):` | @@ -729,8 +729,8 @@ smalruby3-editor の日本語モードは、以下のアーキテクチャで動 - イベントハンドラ(`旗が押されたとき` 以外) - 動き関連メソッド(`move`, `turn_right` 等) - 音関連メソッド(`play`, `stop_all_sounds` 等) -- 見た目の大部分(`say` 以外の `think`, `show`, `hide` 等) -- 調べるの大部分(`ask`/`answer` 以外の `touching?`, `mouse.x` 等) +- 見た目(`say` / `puts` / `print` / `p` の「言う」、`think`, `show`, `hide` 等) +- 調べる(`ask` / `answer` の「聞いて待つ」「答え」、`touching?`, `mouse.x` 等) - `self.属性 = 値` 形式のプロパティ設定 - 正規表現 - `for` / `each` ループ diff --git a/packages/scratch-gui/src/containers/ruby-tab.jsx b/packages/scratch-gui/src/containers/ruby-tab.jsx index ff1296f82be..9e6a8b0a35c 100644 --- a/packages/scratch-gui/src/containers/ruby-tab.jsx +++ b/packages/scratch-gui/src/containers/ruby-tab.jsx @@ -35,6 +35,7 @@ import { FORBIDDEN_PREFIX_ERROR_ID, isRubyCommandName, POST_TEST_LOOP_ERROR_ID, + stageBlockOf, STAGE_VARIABLE_ERROR_ID, UNSUPPORTED_COMMAND_ERROR_ID, UNSUPPORTED_NOTATION_ERROR_ID, @@ -935,6 +936,21 @@ const RubyTab = (props) => { { name: err.name }, ); } + // The say block and ask and answer of the stage tell the console block to use (#2623). + if (err.id === UNSUPPORTED_COMMAND_ERROR_ID && stageBlockOf(err.name) === 'say') { + return intl.formatMessage({ + id: 'gui.rubyTab.dnclSayBlockError', + defaultMessage: + 'The "say" block cannot be used in the Japanese tab. Use "print (…)" of the console instead.', + }); + } + if (err.id === UNSUPPORTED_COMMAND_ERROR_ID && stageBlockOf(err.name) === 'ask') { + return intl.formatMessage({ + id: 'gui.rubyTab.dnclAskBlockError', + defaultMessage: + 'The "ask and wait" and "answer" blocks cannot be used in the Japanese tab. Use "input" of the console instead.', + }); + } if (err.id === UNSUPPORTED_COMMAND_ERROR_ID) { return intl.formatMessage( { diff --git a/packages/scratch-gui/src/lib/dncl/dncl-block-filter.js b/packages/scratch-gui/src/lib/dncl/dncl-block-filter.js index 31116d10cb2..72058d6c763 100644 --- a/packages/scratch-gui/src/lib/dncl/dncl-block-filter.js +++ b/packages/scratch-gui/src/lib/dncl/dncl-block-filter.js @@ -17,12 +17,8 @@ const DNCL_ALLOWED_BLOCKS = [ // Operators: all 'operator_', - // Looks: say with duration (表示する of the programs before the console) - 'looks_sayforsecs', - - // Sensing: ask/answer (【外部からの入力】 of the programs before the console) - 'sensing_askandwait', - 'sensing_answer', + // No looks and sensing blocks: 表示する and 【外部からの入力】 are the console only, not + // "say" and "ask and wait" of the stage (#2623). // Console: 表示する and 【外部からの入力】 (docs/dncl/design.md, chapter 5) 'smalrubyConsole_', @@ -72,7 +68,7 @@ const isDnclAllowedBlock = (opcode) => /** * Categories that are completely hidden in DNCL mode. */ -const DNCL_HIDDEN_CATEGORIES = ['motion', 'sound', 'events']; +const DNCL_HIDDEN_CATEGORIES = ['motion', 'looks', 'sound', 'events', 'sensing']; /** * Check if a category is hidden in DNCL mode. diff --git a/packages/scratch-gui/src/lib/dncl/dncl-keywords.js b/packages/scratch-gui/src/lib/dncl/dncl-keywords.js index f933512062e..ca834bf6779 100644 --- a/packages/scratch-gui/src/lib/dncl/dncl-keywords.js +++ b/packages/scratch-gui/src/lib/dncl/dncl-keywords.js @@ -50,13 +50,9 @@ const RUBY_LITERALS = new Set([ 'true', 'false', 'nil', - 'answer', - 'say', - 'puts', - 'print', - 'ask', + // `say` / `puts` / `print` and `ask` / `answer` are the blocks of the stage, which the + // Japanese tab does not have: they are told as commands, not passed through (#2623). 'rand', - 'ask_and_wait', 'return', 'if', 'elsif', diff --git a/packages/scratch-gui/src/lib/dncl/dncl-validator.js b/packages/scratch-gui/src/lib/dncl/dncl-validator.js index 8dd61452fcc..4ee83c948c9 100644 --- a/packages/scratch-gui/src/lib/dncl/dncl-validator.js +++ b/packages/scratch-gui/src/lib/dncl/dncl-validator.js @@ -74,15 +74,49 @@ const UNSUPPORTED_COMMAND_ERROR_ID = 'unsupportedCommand'; */ const isRubyCommandName = (name) => /^[A-Za-z_]/.test(name); +/** + * The Ruby commands of the blocks of the stage that have a console block for the + * same thing: the "say" block (`say`, and `puts` / `print` / `p`, which the Ruby + * tab makes the say block) and "ask and wait" with "answer". The Japanese tab + * does not have them, so `表示する` and `【外部からの入力】` mean only the console, + * and their errors tell the console block to use (#2623). + */ +const STAGE_BLOCK_COMMANDS = { + say: 'say', + puts: 'say', + print: 'say', + p: 'say', + ask: 'ask', + ask_and_wait: 'ask', + answer: 'ask', +}; + +/** + * The block of the stage a Ruby command is (`say` or `ask`), or null. + * @param {string} name - The name of the command. + * @returns {?string} `say`, `ask` or null. + */ +const stageBlockOf = (name) => + Object.prototype.hasOwnProperty.call(STAGE_BLOCK_COMMANDS, name) ? STAGE_BLOCK_COMMANDS[name] : null; + +/** The messages of the blocks of the stage the Japanese tab does not have, by `stageBlockOf`. */ +const STAGE_BLOCK_MESSAGES = { + say: '「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。', + ask: '「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。', +}; + /** * The message of the unsupported command error. * @param {string} name - The name of the command. * @returns {string} The message. */ -const unsupportedCommandMessage = (name) => - isRubyCommandName(name) +const unsupportedCommandMessage = (name) => { + const stageBlock = stageBlockOf(name); + if (stageBlock) return STAGE_BLOCK_MESSAGES[stageBlock]; + return isRubyCommandName(name) ? `「${name}」は日本語タブでは書けない命令です。ルビータブでは書けます。` : `「${name}」は定義されていない関数です。「関数 ${name}(…):」で定義してください。`; +}; /** * A line that starts with a Ruby keyword that jumps in a loop (`break`, @@ -344,6 +378,7 @@ export { isRubyCommandName, POST_TEST_LOOP_ERROR_ID, POST_TEST_LOOP_MESSAGE, + stageBlockOf, STAGE_VARIABLE_ERROR_ID, stageVariableMessage, UNSUPPORTED_COMMAND_ERROR_ID, diff --git a/packages/scratch-gui/src/lib/dncl/ja-notation-table.js b/packages/scratch-gui/src/lib/dncl/ja-notation-table.js index a51b5e8e876..89a75741c5a 100644 --- a/packages/scratch-gui/src/lib/dncl/ja-notation-table.js +++ b/packages/scratch-gui/src/lib/dncl/ja-notation-table.js @@ -167,23 +167,16 @@ const isConsole = (node, r) => { }; /** - * A call without a receiver that is `表示する`: the "say" of Ruby's `puts`, - * `print`, `p` (the programs of the Japanese mode before the console, and of - * the Ruby tab). Written again from the Japanese, it prints in the console. + * `console.puts(x)` (the console block) that is `表示する`. `puts`, `print`, + * `p` and `say` without a receiver are the "say" block of the stage, which the + * Japanese tab does not have, so `表示する` means only the console (#2623): + * they are told as commands with no Japanese, and the blocks are not changed. * @param {object} call - The call. * @param {object} r - The helpers of ja-notation. * @returns {?object} The Japanese. */ -const display = (call, r) => (call.receiver ? null : r.call('表示する', displayArgs(call.args, r))); - -/** - * `puts` that is `表示する`: `console.puts(x)` (the console block) or `puts(x)`. - * @param {object} call - The call. - * @param {object} r - The helpers of ja-notation. - * @returns {?object} The Japanese. - */ -const consoleOrDisplay = (call, r) => - call.receiver && isConsole(call.receiver, r) ? r.call('表示する', displayArgs(call.args, r)) : display(call, r); +const consoleDisplay = (call, r) => + call.receiver && isConsole(call.receiver, r) ? r.call('表示する', displayArgs(call.args, r)) : null; /** * A method of one value that is a built-in of one argument (`x.to_i` → `整数(x)`). @@ -195,16 +188,7 @@ const builtinOfReceiver = (name) => (call, r) => /** What the calls of Smalruby's Ruby are in the Japanese. */ const rubyCalls = { - puts: consoleOrDisplay, - print: display, - p: display, - // `say(x, 2)` shows for 2 seconds: the Japanese has no time, so it is dropped. - say: (call, r) => { - if (call.receiver) return null; - const last = call.args[call.args.length - 1]; - const timed = call.args.length >= 2 && /^(?:Integer|Float)Node$/.test(r.typeOf(last)); - return r.call('表示する', displayArgs(timed ? call.args.slice(0, -1) : call.args, r)); - }, + puts: consoleDisplay, rand: (call, r) => call.receiver ? null @@ -232,17 +216,6 @@ const rubyCalls = { : null, }; -/** - * Whether a call is `answer` (the answer of the last question). - * @param {object} node - The node. - * @param {object} r - The helpers of ja-notation. - * @returns {boolean} True if it is. - */ -const isAnswer = (node, r) => { - const call = r.callOf(node); - return Boolean(call && call.name === 'answer' && !call.receiver && call.args && call.args.length === 0); -}; - /** * Whether a node is `console.gets` (the input block of the console). * @param {object} node - The node. @@ -261,9 +234,10 @@ const isConsoleInput = (node, r) => { }; /** - * An input: `console.gets` (the input block of the console) on its own line, or - * `ask("")` and the answer on the next line (the programs of the Japanese mode - * before the console); made an integer for `【整数を入力】`. + * An input: `console.gets` (the input block of the console) on its own line, + * made an integer for `【整数を入力】`. `ask` and `answer` (the question of the + * stage) are not inputs: the Japanese tab does not have them, so + * `【外部からの入力】` means only the console (#2623). */ const rubyInput = { kindOfAlone: (value, r) => { @@ -274,20 +248,6 @@ const rubyInput = { } return null; }, - isQuestion: (call, r) => - !call.receiver && - (call.name === 'ask' || call.name === 'ask_and_wait') && - call.args && - call.args.length === 1 && - r.text(call.args[0]) === '""', - kindOf: (value, r) => { - if (isAnswer(value, r)) return 'external'; - const call = r.callOf(value); - if (call && call.name === 'to_i' && call.args && call.args.length === 0 && isAnswer(call.receiver, r)) { - return 'integer'; - } - return null; - }, }; /** The options of `rubyToJa` (ja-notation) for Smalruby's Ruby. */ diff --git a/packages/scratch-gui/src/lib/genai-dncl-prompt.js b/packages/scratch-gui/src/lib/genai-dncl-prompt.js index e6eea339a6f..4e5351fe295 100644 --- a/packages/scratch-gui/src/lib/genai-dncl-prompt.js +++ b/packages/scratch-gui/src/lib/genai-dncl-prompt.js @@ -85,7 +85,7 @@ const dnclRules = () => [ 'コードの前に、何を変えたかを「「もし x > 0 ならば:」の中に「表示する(x)」を足しました」のように、プログラムのことばで 1〜3 行で説明してください。', 'コメントは # で書いてください。// は整数の割り算なので、コメントには使えません。ただし、冒頭に「# 「//」から行の終わりまでは,処理の対象とならない。」があるプログラムでは // がコメントで、整数の割り算は ÷ で書きます。', '「表示する(…)」はコンソールに 1 行出し、「【外部からの入力】」はコンソールで答えを受け取ります(キャラクターのふきだしではありません)。', - '命令は、今のプログラムにある書き方か、下の「書き方と使える命令の例」の書き方で書いてください。イベント(旗が押されたとき など)・音・コスチューム・拡張機能の命令は使えません。', + '命令は、今のプログラムにある書き方か、下の「書き方と使える命令の例」の書き方で書いてください。イベント(旗が押されたとき など)・動き・見た目(言う・コスチューム など)・音・調べる(聞いて待つ・答え など)・拡張機能の命令は使えません。表示は「表示する」、入力は「【外部からの入力】」で書いてください。', `直したプログラムは、「${COPY_START}」の行と「${COPY_END}」の行のあいだに、1 つの \`\`\` と \`\`\` で囲んで書いてください。印の外にはコードを書かないでください(生徒は印のあいだだけをコピーします)。`, 'コードの後に、動かして確かめることを 1 つだけ書いてください。', '高校生にわかる言葉で、短く答えてください。生徒の名前や学校名をたずねないでください。', diff --git a/packages/scratch-gui/src/locales/en.js b/packages/scratch-gui/src/locales/en.js index 7996c83a71d..5db2a53e005 100644 --- a/packages/scratch-gui/src/locales/en.js +++ b/packages/scratch-gui/src/locales/en.js @@ -1772,6 +1772,10 @@ export default { 'Several variables cannot be assigned at once with ",". Assign them one by one (e.g. {example}).', 'gui.rubyTab.dnclMultipleAssignmentErrorNoExample': 'Several variables cannot be assigned at once with ",". Assign them one by one.', + 'gui.rubyTab.dnclSayBlockError': + 'The "say" block cannot be used in the Japanese tab. Use "print (…)" of the console instead.', + 'gui.rubyTab.dnclAskBlockError': + 'The "ask and wait" and "answer" blocks cannot be used in the Japanese tab. Use "input" of the console instead.', 'gui.rubyTab.dnclUnsupportedCommandError': '"{name}" is a command that cannot be written in the Japanese tab. You can write it in the Ruby tab.', 'gui.rubyTab.dnclUnsupportedNotationError': diff --git a/packages/scratch-gui/src/locales/ja-Hira.js b/packages/scratch-gui/src/locales/ja-Hira.js index ef91fe2b6af..fe02fc5d681 100644 --- a/packages/scratch-gui/src/locales/ja-Hira.js +++ b/packages/scratch-gui/src/locales/ja-Hira.js @@ -2153,6 +2153,10 @@ export default { '「,」でくぎって、いくつかのへんすうにまとめてだいにゅうすることはできません。1 つずつだいにゅうしてください(れい: {example})。', 'gui.rubyTab.dnclMultipleAssignmentErrorNoExample': '「,」でくぎって、いくつかのへんすうにまとめてだいにゅうすることはできません。1 つずつだいにゅうしてください。', + 'gui.rubyTab.dnclSayBlockError': + '「いう」は、にほんごタブではつかえないブロックです。コンソールの「(…) をひょうじする」をつかってください。', + 'gui.rubyTab.dnclAskBlockError': + '「きいてまつ」と「こたえ」は、にほんごタブではつかえないブロックです。コンソールの「にゅうりょくする」をつかってください。', 'gui.rubyTab.dnclUnsupportedCommandError': '「{name}」は、にほんごタブではかけないめいれいです。ルビータブではかけます。', 'gui.rubyTab.dnclUnsupportedNotationError': '「{name}」は、にほんごタブではかけません。ルビータブではかけます。', diff --git a/packages/scratch-gui/src/locales/ja.js b/packages/scratch-gui/src/locales/ja.js index 767b7f2c7e0..829063453c5 100644 --- a/packages/scratch-gui/src/locales/ja.js +++ b/packages/scratch-gui/src/locales/ja.js @@ -2102,6 +2102,10 @@ export default { '「,」で区切って、いくつかの変数にまとめて代入することはできません。1 つずつ代入してください(例: {example})。', 'gui.rubyTab.dnclMultipleAssignmentErrorNoExample': '「,」で区切って、いくつかの変数にまとめて代入することはできません。1 つずつ代入してください。', + 'gui.rubyTab.dnclSayBlockError': + '「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。', + 'gui.rubyTab.dnclAskBlockError': + '「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。', 'gui.rubyTab.dnclUnsupportedCommandError': '「{name}」は日本語タブでは書けない命令です。ルビータブでは書けます。', 'gui.rubyTab.dnclUnsupportedNotationError': '「{name}」は日本語タブでは書けません。ルビータブでは書けます。', 'gui.rubyTab.dnclUnsupportedNumberError': diff --git a/packages/scratch-gui/test/fixtures/ja-notation/golden/ja.json b/packages/scratch-gui/test/fixtures/ja-notation/golden/ja.json index 7eaf7147c61..36638df4416 100644 --- a/packages/scratch-gui/test/fixtures/ja-notation/golden/ja.json +++ b/packages/scratch-gui/test/fixtures/ja-notation/golden/ja.json @@ -440,6 +440,13 @@ "id": "unsupportedCommand", "name": "len", "message": "「len」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 4, + "column": 5, + "id": "unsupportedCommand", + "name": "print", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ] }, diff --git a/packages/scratch-gui/test/fixtures/ja-notation/golden/ruby.json b/packages/scratch-gui/test/fixtures/ja-notation/golden/ruby.json index 03f6826aa94..afd915551f2 100644 --- a/packages/scratch-gui/test/fixtures/ja-notation/golden/ruby.json +++ b/packages/scratch-gui/test/fixtures/ja-notation/golden/ruby.json @@ -1,6 +1,6 @@ { "ruby-07ab982fbe": { - "ja": "もし direction > 90 ならば:\n 表示する(文字列(y_position))", + "ja": "もし direction > 90 ならば:\n puts(文字列(y_position))", "errors": [ { "line": 1, @@ -9,6 +9,13 @@ "name": "direction", "message": "「direction」は日本語タブでは書けない命令です。ルビータブでは書けます。" }, + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + }, { "line": 2, "column": 8, @@ -18,13 +25,28 @@ } ], "back": { - "ruby": "if @direction > 90\n console.puts(@y_position.to_s)\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-479055452c": { - "ja": "表示する(costume_number)", + "ja": "puts(costume_number)", "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + }, { "line": 1, "column": 6, @@ -34,8 +56,16 @@ } ], "back": { - "ruby": "console.puts(@costume_number)", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-1365258296": { @@ -55,7 +85,7 @@ } }, "ruby-22a7460321": { - "ja": "i = 1\ni <= x_position の間繰り返す:\n 表示する(i)\n i += costume_number", + "ja": "i = 1\ni <= x_position の間繰り返す:\n puts(i)\n i += costume_number", "errors": [ { "line": 2, @@ -64,6 +94,13 @@ "name": "x_position", "message": "「x_position」は日本語タブでは書けない命令です。ルビータブでは書けます。" }, + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + }, { "line": 4, "column": 9, @@ -73,8 +110,16 @@ } ], "back": { - "ruby": "@i = 1\nwhile @i <= @x_position\n console.puts(@i)\n @i += @costume_number\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 3, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-604fe0a397": { @@ -102,11 +147,27 @@ } }, "ruby-2fdccc8f04": { - "ja": "表示する(\"x_position\")\na = 1 # x_position", - "errors": [], + "ja": "puts(\"x_position\")\na = 1 # x_position", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(\"x_position\")\n@a = 1 # x_position", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-58cf3ef45c": { @@ -126,19 +187,51 @@ } }, "ruby-b5bb6c47cd": { - "ja": "i を 1 から 3 まで 1 ずつ増やしながら繰り返す:\n 表示する(i)", - "errors": [], + "ja": "i を 1 から 3 まで 1 ずつ増やしながら繰り返す:\n puts(i)", + "errors": [ + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 1\nwhile @i <= 3\n console.puts(@i)\n @i += 1\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-07b0faa6ff": { - "ja": "関数 greet():\n 表示する(\"hi\")\na = greet", - "errors": [], + "ja": "関数 greet():\n puts(\"hi\")\na = greet", + "errors": [ + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "def greet()\n console.puts(\"hi\")\nend\n@a = greet", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-115bfe2a31": { @@ -158,11 +251,48 @@ } }, "ruby-c86e6cfe97": { - "ja": "a = 【外部からの入力】\nb = 乱数(1..6)\nc = 整数(a) + 要素数(b)\n表示する(真 and not 偽)", - "errors": [], + "ja": "ask(\"\")\na = answer\nb = 乱数(1..6)\nc = 整数(a) + 要素数(b)\nputs(真 and not 偽)", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "ask", + "message": "「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。" + }, + { + "line": 2, + "column": 6, + "id": "unsupportedCommand", + "name": "answer", + "message": "「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。" + }, + { + "line": 5, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@a = console.gets\n@b = rand(1..6)\n@c = @a.to_i + @b.length\nconsole.puts(true && !false)", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "ask", + "message": "「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。" + }, + { + "line": 5, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-0560bfb414": { @@ -197,11 +327,27 @@ } }, "ruby-d3d541db91": { - "ja": "a, b = 1, 2\n表示する(a + b)", - "errors": [], + "ja": "a, b = 1, 2\nputs(a + b)", + "errors": [ + { + "line": 2, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@a, @b = 1, 2\nconsole.puts(@a + @b)", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-5185405f54": { @@ -421,11 +567,27 @@ } }, "ruby-b58350ef0e": { - "ja": "表示する(文字列(a + 1))", - "errors": [], + "ja": "puts(文字列(a + 1))", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts((@a + 1).to_s)", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-0aa55ce178": { @@ -565,147 +727,435 @@ } }, "ruby-40184cb496": { - "ja": "表示する(-1, \"個\")", - "errors": [], + "ja": "puts(文字列(-1) + \"個\")", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(-1.to_s + \"個\")", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-0a2ba5c834": { - "ja": "i を 10 から 1 まで 1 ずつ減らしながら繰り返す:\n 表示する(i)", - "errors": [], + "ja": "i を 10 から 1 まで 1 ずつ減らしながら繰り返す:\n puts(i)", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 10\nwhile @i >= 1\n console.puts(@i)\n @i += -1\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-eac61b8424": { - "ja": "i を 10 から 1 まで 1 ずつ減らしながら繰り返す:\n 表示する(i)", - "errors": [], + "ja": "i を 10 から 1 まで 1 ずつ減らしながら繰り返す:\n puts(i)", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 10\nwhile @i >= 1\n console.puts(@i)\n @i += -1\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-0edccbf106": { - "ja": "i を 10 から 1 まで a + 1 ずつ減らしながら繰り返す:\n 表示する(i)", - "errors": [], + "ja": "i を 10 から 1 まで a + 1 ずつ減らしながら繰り返す:\n puts(i)", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 10\nwhile @i >= 1\n console.puts(@i)\n @i += -(@a + 1)\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-1826f3c819": { - "ja": "i を 10 から 1 まで a + 1 ずつ減らしながら繰り返す:\n 表示する(i)", - "errors": [], + "ja": "i を 10 から 1 まで a + 1 ずつ減らしながら繰り返す:\n puts(i)", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 10\nwhile @i >= 1\n console.puts(@i)\n @i += -(@a + 1)\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-ecb792978f": { - "ja": "i を 10 から 1 まで 1 ずつ減らしながら繰り返す:\n 表示する(i)", - "errors": [], + "ja": "i を 10 から 1 まで 1 ずつ減らしながら繰り返す:\n puts(i)", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 10\nwhile @i >= 1\n console.puts(@i)\n @i += -1\nend", - "errors": [] - } - }, - "ruby-40fd298179": { - "ja": "i を 1 から 10 まで 2 ずつ増やしながら繰り返す:\n 表示する(i)", - "errors": [], + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] + } + }, + "ruby-40fd298179": { + "ja": "i を 1 から 10 まで 2 ずつ増やしながら繰り返す:\n puts(i)", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 1\nwhile @i <= 10\n console.puts(@i)\n @i += 2\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-666e4eeb94": { - "ja": "i を 0 から 10 まで 整数(s) ずつ増やしながら繰り返す:\n 表示する(i)", - "errors": [], + "ja": "i を 0 から 10 まで 整数(s) ずつ増やしながら繰り返す:\n puts(i)", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 0\nwhile @i <= 10\n console.puts(@i)\n @i += @s.to_i\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-6325bde02c": { - "ja": "i を 0 から 10 まで s ÷ 2 ずつ増やしながら繰り返す:\n 表示する(i)", - "errors": [], + "ja": "i を 0 から 10 まで s ÷ 2 ずつ増やしながら繰り返す:\n puts(i)", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 0\nwhile @i <= 10\n console.puts(@i)\n @i += (@s / 2).to_i\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-ce706afc40": { - "ja": "i を 10 から 0 まで s ÷ 2 ずつ減らしながら繰り返す:\n 表示する(i)", - "errors": [], + "ja": "i を 10 から 0 まで s ÷ 2 ずつ減らしながら繰り返す:\n puts(i)", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 10\nwhile @i >= 0\n console.puts(@i)\n @i += -((@s / 2).to_i)\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-f52610a623": { - "ja": "i を 0 から 10 まで s ずつ増やしながら繰り返す:\n 表示する(i)", - "errors": [], + "ja": "i を 0 から 10 まで s ずつ増やしながら繰り返す:\n puts(i)", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 0\nwhile @i <= 10\n console.puts(@i)\n @i += @s\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-39dda102a3": { - "ja": "i を 1 から 10 まで 1 ずつ増やしながら繰り返す:\n 表示する(i)\n\n", - "errors": [], + "ja": "i を 1 から 10 まで 1 ずつ増やしながら繰り返す:\n puts(i)\n\n", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 1\nwhile @i <= 10\n console.puts(@i)\n @i += 1\nend\n\n", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-ab7c89e93a": { - "ja": "i を 1 から 10 まで 1 ずつ増やしながら繰り返す:\n 表示する(i)\n\n", - "errors": [], + "ja": "i を 1 から 10 まで 1 ずつ増やしながら繰り返す:\n puts(i)\n\n", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 1\nwhile @i <= 10\n console.puts(@i)\n @i += 1\nend\n\n", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-874b62cf69": { - "ja": "i を 1 から 10 まで 1 ずつ増やしながら繰り返す: # a # b\n 表示する(i) # c\nを繰り返す # d # e", - "errors": [], + "ja": "i を 1 から 10 まで 1 ずつ増やしながら繰り返す: # a # b\n puts(i) # c\nを繰り返す # d # e", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 1\nwhile @i <= 10 # a # b\n console.puts(@i) # c\n @i += 1\nend # d # e", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-cc6af134bb": { - "ja": "i を 1 から 10 まで 1 ずつ増やしながら繰り返す: # a # b\n 表示する(i) # c\nを繰り返す # d # e", - "errors": [], + "ja": "i を 1 から 10 まで 1 ずつ増やしながら繰り返す: # a # b\n puts(i) # c\nを繰り返す # d # e", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 1\nwhile @i <= 10 # a # b\n console.puts(@i) # c\n @i += 1\nend # d # e", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-b4101ddb2f": { - "ja": "i を 1 から 3 まで 1 ずつ増やしながら繰り返す:\n j = 1\n j <= 3 の間繰り返す:\n j += 1\n 表示する(j)", - "errors": [], + "ja": "i を 1 から 3 まで 1 ずつ増やしながら繰り返す:\n j = 1\n j <= 3 の間繰り返す:\n j += 1\n puts(j)", + "errors": [ + { + "line": 6, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 1\nwhile @i <= 3\n @j = 1\n while @j <= 3\n @j += 1\n console.puts(@j)\n end\n @i += 1\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 5, + "column": 9, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-1fe6a5d5b4": { - "ja": "i = 1\ni <= 3 の間繰り返す:\n i += 1\n j を 1 から 3 まで 1 ずつ増やしながら繰り返す:\n 表示する(j)", - "errors": [], + "ja": "i = 1\ni <= 3 の間繰り返す:\n i += 1\n j を 1 から 3 まで 1 ずつ増やしながら繰り返す:\n puts(j)", + "errors": [ + { + "line": 6, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 1\nwhile @i <= 3\n @i += 1\n @j = 1\n while @j <= 3\n console.puts(@j)\n @j += 1\n end\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 5, + "column": 9, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-d1af138e90": { - "ja": "i = 1\ni <= 3 の間繰り返す:\n i を 1 から 3 まで 1 ずつ増やしながら繰り返す:\n 表示する(i)\n i += 1", - "errors": [], + "ja": "i = 1\ni <= 3 の間繰り返す:\n i を 1 から 3 まで 1 ずつ増やしながら繰り返す:\n puts(i)\n i += 1", + "errors": [ + { + "line": 5, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 1\nwhile @i <= 3\n @i = 1\n while @i <= 3\n console.puts(@i)\n @i += 1\n end\n @i += 1\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 4, + "column": 9, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-ba0cf5440f": { @@ -717,35 +1167,99 @@ } }, "ruby-038864683e": { - "ja": "i = 1\ni <= 10 の間繰り返す:\n i += 1\n 表示する(i)", - "errors": [], + "ja": "i = 1\ni <= 10 の間繰り返す:\n i += 1\n puts(i)", + "errors": [ + { + "line": 4, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 1\nwhile @i <= 10\n @i += 1\n console.puts(@i)\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 4, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-dd5f709880": { - "ja": "i = 10\ni >= 1 の間繰り返す:\n 表示する(i)\n i += -a + 1", - "errors": [], + "ja": "i = 10\ni >= 1 の間繰り返す:\n puts(i)\n i += -a + 1", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 10\nwhile @i >= 1\n console.puts(@i)\n @i += -@a + 1\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 3, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-c2b1b186e6": { - "ja": "i = 1\ni <= 10 の間繰り返す:\n 表示する(i)\n i += 乱数(3)", - "errors": [], - "back": { - "ruby": "@i = 1\nwhile @i <= 10\n console.puts(@i)\n @i += rand(3)\nend", - "errors": [] - } - }, - "ruby-c67674a2f5": { - "ja": "i = 1\ni <= 10 の間繰り返す:\n 表示する(i)\n i -= 1", - "errors": [], + "ja": "i = 1\ni <= 10 の間繰り返す:\n puts(i)\n i += 乱数(3)", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 1\nwhile @i <= 10\n console.puts(@i)\n @i -= 1\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 3, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] + } + }, + "ruby-c67674a2f5": { + "ja": "i = 1\ni <= 10 の間繰り返す:\n puts(i)\n i -= 1", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], + "back": { + "ruby": null, + "errors": [ + { + "line": 3, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-6f77dfe34c": { @@ -757,286 +1271,118 @@ } }, "ruby-286ce10d66": { - "ja": "i = 1\ni <= 100 の間繰り返す:\n 表示する(i)\n i += i", - "errors": [], - "back": { - "ruby": "@i = 1\nwhile @i <= 100\n console.puts(@i)\n @i += @i\nend", - "errors": [] - } - }, - "ruby-850efac48d": { - "ja": "i = 1\ni <= 10 の間繰り返す:\n i = i * 2\n 表示する(i)\n i += 1", - "errors": [], - "back": { - "ruby": "@i = 1\nwhile @i <= 10\n @i = @i * 2\n console.puts(@i)\n @i += 1\nend", - "errors": [] - } - }, - "ruby-b2c1584066": { - "ja": "i = 1\ni <= 10 の間繰り返す:\n i += 1\n 表示する(i)\n i += 1", - "errors": [], - "back": { - "ruby": "@i = 1\nwhile @i <= 10\n @i += 1\n console.puts(@i)\n @i += 1\nend", - "errors": [] - } - }, - "ruby-b58097df4a": { - "ja": "i = 1\ni <= 10 の間繰り返す:\n i, j = 5, 0\n i += 1", - "errors": [], - "back": { - "ruby": "@i = 1\nwhile @i <= 10\n @i, @j = 5, 0\n @i += 1\nend", - "errors": [] - } - }, - "ruby-519406224b": { - "ja": "i = 1 # a\ni <= 10 の間繰り返す: # b\n i += 1 # c\n 表示する(i) # d\nを繰り返す # e", - "errors": [], - "back": { - "ruby": "@i = 1 # a\nwhile @i <= 10 # b\n @i += 1 # c\n console.puts(@i) # d\nend # e", - "errors": [] - } - }, - "ruby-aed0b4f4d6": { - "ja": "表示する(\"a\", \"b\", \"c\")", - "errors": [], - "back": { - "ruby": "console.puts(\"a\" + \"b\" + \"c\")", - "errors": [] - } - }, - "ruby-938a12a4d1": { - "ja": "表示する(\"添字\", \" \", \"要素\")", - "errors": [], - "back": { - "ruby": "console.puts(\"添字\" + \" \" + \"要素\")", - "errors": [] - } - }, - "ruby-1d4c1565e6": { - "ja": "表示する(1, \"は\", 2, \"番目\")", - "errors": [], - "back": { - "ruby": "console.puts(1.to_s + \"は\" + 2.to_s + \"番目\")", - "errors": [] - } - }, - "ruby-a4ab20af7b": { - "ja": "表示する(a, \"は\", b)", - "errors": [], - "back": { - "ruby": "console.puts(@a.to_s + \"は\" + @b.to_s)", - "errors": [] - } - }, - "ruby-b18df705da": { - "ja": "表示する(a + b)", - "errors": [], - "back": { - "ruby": "console.puts(@a + @b)", - "errors": [] - } - }, - "ruby-fe55f457b1": { - "ja": "表示する(a, \"は\", b)", - "errors": [], - "back": { - "ruby": "console.puts(@a.to_s + \"は\" + @b.to_s)", - "errors": [] - } - }, - "ruby-c24aeb57ff": { - "ja": "表示する(x + 1)", - "errors": [], - "back": { - "ruby": "console.puts(@x + 1)", - "errors": [] - } - }, - "ruby-1b8659c531": { - "ja": "表示する(\"a\", \"b\", \"c\")", - "errors": [], - "back": { - "ruby": "console.puts(\"a\" + \"b\" + \"c\")", - "errors": [] - } - }, - "ruby-7826b0588b": { - "ja": "表示する(not x, y)", - "errors": [], - "back": { - "ruby": "console.puts((!@x).to_s + @y.to_s)", - "errors": [] - } - }, - "ruby-e9fb87e710": { - "ja": "表示する(a, b + 1)", - "errors": [], - "back": { - "ruby": "console.puts(@a.to_s + (@b + 1).to_s)", - "errors": [] - } - }, - "ruby-c90253c67d": { - "ja": "表示する(\"合計\", a * 2)", - "errors": [], - "back": { - "ruby": "console.puts(\"合計\" + (@a * 2).to_s)", - "errors": [] - } - }, - "ruby-edca6f4828": { - "ja": "表示する(a + 1, b)", - "errors": [], - "back": { - "ruby": "console.puts((@a + 1).to_s + @b.to_s)", - "errors": [] - } - }, - "ruby-9d84e5391b": { - "ja": "a < 1 の間繰り返す:\n [1, 2].each do |x, y|\n move(2)\n end", + "ja": "i = 1\ni <= 100 の間繰り返す:\n puts(i)\n i += i", "errors": [ - { - "line": 2, - "column": 10, - "id": "unsupportedCommand", - "name": "each", - "message": "「each」は日本語タブでは書けない命令です。ルビータブでは書けます。" - }, { "line": 3, - "column": 5, + "column": 3, "id": "unsupportedCommand", - "name": "move", - "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ], "back": { "ruby": null, "errors": [ - { - "line": 2, - "column": 12, - "id": "unsupportedCommand", - "name": "each", - "message": "「each」は日本語タブでは書けない命令です。ルビータブでは書けます。" - }, { "line": 3, - "column": 7, + "column": 5, "id": "unsupportedCommand", - "name": "move", - "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ] } }, - "ruby-61a21afaf1": { - "ja": "a < 1 の間繰り返す:\n @list.each do |x|\n move(2)\n end", + "ruby-850efac48d": { + "ja": "i = 1\ni <= 10 の間繰り返す:\n i = i * 2\n puts(i)\n i += 1", "errors": [ { - "line": 2, - "column": 9, - "id": "unsupportedCommand", - "name": "each", - "message": "「each」は日本語タブでは書けない命令です。ルビータブでは書けます。" - }, - { - "line": 3, - "column": 5, + "line": 4, + "column": 3, "id": "unsupportedCommand", - "name": "move", - "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ], "back": { "ruby": null, "errors": [ { - "line": 2, + "line": 4, "column": 5, - "id": "forbiddenPrefix", - "name": "@", - "message": "日本語タブでは変数に「@」は使えません" - }, - { - "line": 2, - "column": 11, "id": "unsupportedCommand", - "name": "each", - "message": "「each」は日本語タブでは書けない命令です。ルビータブでは書けます。" - }, + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] + } + }, + "ruby-b2c1584066": { + "ja": "i = 1\ni <= 10 の間繰り返す:\n i += 1\n puts(i)\n i += 1", + "errors": [ + { + "line": 4, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], + "back": { + "ruby": null, + "errors": [ { - "line": 3, - "column": 7, + "line": 4, + "column": 5, "id": "unsupportedCommand", - "name": "move", - "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ] } }, - "ruby-c96ce9ba3f": { - "ja": "もし a < 1 ならば:\n i を 1 から 3 まで 1 ずつ増やしながら繰り返す:\n b = b + 1", + "ruby-b58097df4a": { + "ja": "i = 1\ni <= 10 の間繰り返す:\n i, j = 5, 0\n i += 1", "errors": [], "back": { - "ruby": "if @a < 1\n @i = 1\n while @i <= 3\n @b = @b + 1\n @i += 1\n end\nend", + "ruby": "@i = 1\nwhile @i <= 10\n @i, @j = 5, 0\n @i += 1\nend", "errors": [] } }, - "ruby-0a32d06e0c": { - "ja": "a < 1 の間繰り返す:\n loop do # forever\n move(1)\n end", + "ruby-519406224b": { + "ja": "i = 1 # a\ni <= 10 の間繰り返す: # b\n i += 1 # c\n puts(i) # d\nを繰り返す # e", "errors": [ { - "line": 2, + "line": 4, "column": 3, "id": "unsupportedCommand", - "name": "loop", - "message": "「loop」は日本語タブでは書けない命令です。ルビータブでは書けます。" - }, - { - "line": 3, - "column": 5, - "id": "unsupportedCommand", - "name": "move", - "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ], "back": { "ruby": null, "errors": [ { - "line": 2, + "line": 4, "column": 5, "id": "unsupportedCommand", - "name": "loop", - "message": "「loop」は日本語タブでは書けない命令です。ルビータブでは書けます。" - }, - { - "line": 3, - "column": 7, - "id": "unsupportedCommand", - "name": "move", - "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ] } }, - "ruby-6baae9610c": { - "ja": "when_flag_clicked do\n move(2)\nend", + "ruby-aed0b4f4d6": { + "ja": "puts(\"a\" + \"b\" + \"c\")", "errors": [ { "line": 1, "column": 1, "id": "unsupportedCommand", - "name": "when_flag_clicked", - "message": "「when_flag_clicked」は日本語タブでは書けない命令です。ルビータブでは書けます。" - }, - { - "line": 2, - "column": 3, - "id": "unsupportedCommand", - "name": "move", - "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ], "back": { @@ -1046,47 +1392,21 @@ "line": 1, "column": 1, "id": "unsupportedCommand", - "name": "when_flag_clicked", - "message": "「when_flag_clicked」は日本語タブでは書けない命令です。ルビータブでは書けます。" - }, - { - "line": 2, - "column": 3, - "id": "unsupportedCommand", - "name": "move", - "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ] } }, - "ruby-1983a2aeae": { - "ja": "begin\n with_screen_refresh do\n move(2)\n end\nend while @a < 1", + "ruby-938a12a4d1": { + "ja": "puts(\"添字\" + \" \" + \"要素\")", "errors": [ { "line": 1, "column": 1, - "id": "postTestLoop", - "message": "後判定の繰り返し(先に 1 回動かしてから条件を確かめる繰り返し)は日本語では書けません。最初の 1 回をループの前に書いてから、「〜の間繰り返す」にしてください。ルビータブでは書けます。" - }, - { - "line": 2, - "column": 3, "id": "unsupportedCommand", - "name": "with_screen_refresh", - "message": "「with_screen_refresh」は日本語タブでは書けない命令です。ルビータブでは書けます。" - }, - { - "line": 3, - "column": 5, - "id": "unsupportedCommand", - "name": "move", - "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" - }, - { - "line": 5, - "column": 1, - "id": "postTestLoop", - "message": "後判定の繰り返し(先に 1 回動かしてから条件を確かめる繰り返し)は日本語では書けません。最初の 1 回をループの前に書いてから、「〜の間繰り返す」にしてください。ルビータブでは書けます。" + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ], "back": { @@ -1095,280 +1415,774 @@ { "line": 1, "column": 1, - "id": "postTestLoop", - "message": "後判定の繰り返し(先に 1 回動かしてから条件を確かめる繰り返し)は日本語では書けません。最初の 1 回をループの前に書いてから、「〜の間繰り返す」にしてください。ルビータブでは書けます。" - }, - { - "line": 2, - "column": 3, - "id": "unsupportedCommand", - "name": "with_screen_refresh", - "message": "「with_screen_refresh」は日本語タブでは書けない命令です。ルビータブでは書けます。" - }, - { - "line": 3, - "column": 5, "id": "unsupportedCommand", - "name": "move", - "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" - }, - { - "line": 5, - "column": 1, - "id": "postTestLoop", - "message": "後判定の繰り返し(先に 1 回動かしてから条件を確かめる繰り返し)は日本語では書けません。最初の 1 回をループの前に書いてから、「〜の間繰り返す」にしてください。ルビータブでは書けます。" + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ] } }, - "ruby-b633dac76d": { - "ja": "a < 1 の間繰り返す:\n move(1) # what to do\n 表示する(\"#\") # do", + "ruby-1d4c1565e6": { + "ja": "puts(文字列(1) + \"は\" + 文字列(2) + \"番目\")", "errors": [ { - "line": 2, - "column": 3, + "line": 1, + "column": 1, "id": "unsupportedCommand", - "name": "move", - "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ], "back": { "ruby": null, "errors": [ { - "line": 2, - "column": 5, + "line": 1, + "column": 1, "id": "unsupportedCommand", - "name": "move", - "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ] } }, - "ruby-c14318c6c6": { - "ja": "a < 1 の間繰り返す:\n 表示する(\"do\")\n 表示する(\"a do\")", - "errors": [], - "back": { - "ruby": "while @a < 1\n console.puts(\"do\")\n console.puts(\"a do\")\nend", - "errors": [] - } - }, - "ruby-6da82361be": { - "ja": "関数 f(x):\n a < 1 の間繰り返す:\n loop do\n [1, 2].each do |y|\n if @a\n move(y)\n end\n end\n end", + "ruby-a4ab20af7b": { + "ja": "puts(文字列(a) + \"は\" + 文字列(b))", "errors": [ { - "line": 3, - "column": 5, - "id": "unsupportedCommand", - "name": "loop", - "message": "「loop」は日本語タブでは書けない命令です。ルビータブでは書けます。" - }, - { - "line": 4, - "column": 14, - "id": "unsupportedCommand", - "name": "each", - "message": "「each」は日本語タブでは書けない命令です。ルビータブでは書けます。" - }, - { - "line": 6, - "column": 11, + "line": 1, + "column": 1, "id": "unsupportedCommand", - "name": "move", - "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ], "back": { "ruby": null, "errors": [ { - "line": 3, - "column": 9, - "id": "unsupportedCommand", - "name": "loop", - "message": "「loop」は日本語タブでは書けない命令です。ルビータブでは書けます。" - }, - { - "line": 4, - "column": 18, - "id": "unsupportedCommand", - "name": "each", - "message": "「each」は日本語タブでは書けない命令です。ルビータブでは書けます。" - }, - { - "line": 5, - "column": 16, - "id": "forbiddenPrefix", - "name": "@", - "message": "日本語タブでは変数に「@」は使えません" - }, - { - "line": 6, - "column": 15, + "line": 1, + "column": 1, "id": "unsupportedCommand", - "name": "move", - "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ] } }, - "ruby-4aaad0975d": { - "ja": "a < 1 の間繰り返す:\n self.when(:clicked) do\n move(2)\n end", + "ruby-b18df705da": { + "ja": "puts(a + b)", "errors": [ { - "line": 2, - "column": 8, - "id": "unsupportedCommand", - "name": "when", - "message": "「when」は日本語タブでは書けない命令です。ルビータブでは書けます。" - }, - { - "line": 3, - "column": 5, + "line": 1, + "column": 1, "id": "unsupportedCommand", - "name": "move", - "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ], "back": { "ruby": null, "errors": [ { - "line": 2, - "column": 10, - "id": "unsupportedCommand", - "name": "when", - "message": "「when」は日本語タブでは書けない命令です。ルビータブでは書けます。" - }, - { - "line": 3, - "column": 7, + "line": 1, + "column": 1, "id": "unsupportedCommand", - "name": "move", - "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ] } }, - "ruby-533fd2bdc7": { - "ja": "a < 1 の間繰り返す:\n with_screen_refresh do\n @b = 1\n end", + "ruby-fe55f457b1": { + "ja": "puts(文字列(a) + \"は\" + 文字列(b))", "errors": [ { - "line": 2, - "column": 3, + "line": 1, + "column": 1, "id": "unsupportedCommand", - "name": "with_screen_refresh", - "message": "「with_screen_refresh」は日本語タブでは書けない命令です。ルビータブでは書けます。" + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ], "back": { "ruby": null, "errors": [ { - "line": 2, - "column": 5, + "line": 1, + "column": 1, "id": "unsupportedCommand", - "name": "with_screen_refresh", - "message": "「with_screen_refresh」は日本語タブでは書けない命令です。ルビータブでは書けます。" - }, - { - "line": 3, - "column": 7, - "id": "forbiddenPrefix", - "name": "@", - "message": "日本語タブでは変数に「@」は使えません" + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ] } }, - "ruby-7f4bb92f22": { - "ja": "a < 1 の間繰り返す:\n not x > 1 の間繰り返す:\n を繰り返す\n a = a + 1", - "errors": [], + "ruby-c24aeb57ff": { + "ja": "puts(x + 1)", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "while @a < 1\n until @x > 1\n end\n @a = @a + 1\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, - "ruby-6e43ecf036": { - "ja": "a < 1 の間繰り返す:\n when_flag_clicked do\n move(2)\n end", + "ruby-1b8659c531": { + "ja": "say(\"a\" + \"b\" + \"c\", 1)", "errors": [ { - "line": 2, - "column": 3, - "id": "unsupportedCommand", - "name": "when_flag_clicked", - "message": "「when_flag_clicked」は日本語タブでは書けない命令です。ルビータブでは書けます。" - }, - { - "line": 3, - "column": 5, + "line": 1, + "column": 1, "id": "unsupportedCommand", - "name": "move", - "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ], "back": { "ruby": null, "errors": [ { - "line": 2, - "column": 5, - "id": "unsupportedCommand", - "name": "when_flag_clicked", - "message": "「when_flag_clicked」は日本語タブでは書けない命令です。ルビータブでは書けます。" - }, - { - "line": 3, - "column": 7, + "line": 1, + "column": 1, "id": "unsupportedCommand", - "name": "move", - "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ] } }, - "ruby-2a0da5dba7": { - "ja": "a < 1 の間繰り返す:\n when_key_pressed(\"space\") do\n move(2)\n end", + "ruby-7826b0588b": { + "ja": "puts(文字列(not x) + 文字列(y))", "errors": [ { - "line": 2, - "column": 3, - "id": "unsupportedCommand", - "name": "when_key_pressed", - "message": "「when_key_pressed」は日本語タブでは書けない命令です。ルビータブでは書けます。" - }, - { - "line": 3, - "column": 5, + "line": 1, + "column": 1, "id": "unsupportedCommand", - "name": "move", - "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ], "back": { "ruby": null, "errors": [ { - "line": 2, - "column": 5, - "id": "unsupportedCommand", - "name": "when_key_pressed", - "message": "「when_key_pressed」は日本語タブでは書けない命令です。ルビータブでは書けます。" - }, - { - "line": 3, - "column": 7, + "line": 1, + "column": 1, "id": "unsupportedCommand", - "name": "move", - "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ] } }, - "ruby-9173ca31c6": { - "ja": "a = 0\nnot a > 10 の間繰り返す:\n a += 1", - "errors": [], - "back": { + "ruby-e9fb87e710": { + "ja": "puts(文字列(a) + 文字列(b + 1))", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], + "back": { + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] + } + }, + "ruby-c90253c67d": { + "ja": "puts(\"合計\" + 文字列(a * 2))", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], + "back": { + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] + } + }, + "ruby-edca6f4828": { + "ja": "puts(文字列(a + 1) + 文字列(b))", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], + "back": { + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] + } + }, + "ruby-9d84e5391b": { + "ja": "a < 1 の間繰り返す:\n [1, 2].each do |x, y|\n move(2)\n end", + "errors": [ + { + "line": 2, + "column": 10, + "id": "unsupportedCommand", + "name": "each", + "message": "「each」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 3, + "column": 5, + "id": "unsupportedCommand", + "name": "move", + "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + } + ], + "back": { + "ruby": null, + "errors": [ + { + "line": 2, + "column": 12, + "id": "unsupportedCommand", + "name": "each", + "message": "「each」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 3, + "column": 7, + "id": "unsupportedCommand", + "name": "move", + "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + } + ] + } + }, + "ruby-61a21afaf1": { + "ja": "a < 1 の間繰り返す:\n @list.each do |x|\n move(2)\n end", + "errors": [ + { + "line": 2, + "column": 9, + "id": "unsupportedCommand", + "name": "each", + "message": "「each」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 3, + "column": 5, + "id": "unsupportedCommand", + "name": "move", + "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + } + ], + "back": { + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "forbiddenPrefix", + "name": "@", + "message": "日本語タブでは変数に「@」は使えません" + }, + { + "line": 2, + "column": 11, + "id": "unsupportedCommand", + "name": "each", + "message": "「each」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 3, + "column": 7, + "id": "unsupportedCommand", + "name": "move", + "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + } + ] + } + }, + "ruby-c96ce9ba3f": { + "ja": "もし a < 1 ならば:\n i を 1 から 3 まで 1 ずつ増やしながら繰り返す:\n b = b + 1", + "errors": [], + "back": { + "ruby": "if @a < 1\n @i = 1\n while @i <= 3\n @b = @b + 1\n @i += 1\n end\nend", + "errors": [] + } + }, + "ruby-0a32d06e0c": { + "ja": "a < 1 の間繰り返す:\n loop do # forever\n move(1)\n end", + "errors": [ + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "loop", + "message": "「loop」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 3, + "column": 5, + "id": "unsupportedCommand", + "name": "move", + "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + } + ], + "back": { + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "loop", + "message": "「loop」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 3, + "column": 7, + "id": "unsupportedCommand", + "name": "move", + "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + } + ] + } + }, + "ruby-6baae9610c": { + "ja": "when_flag_clicked do\n move(2)\nend", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "when_flag_clicked", + "message": "「when_flag_clicked」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "move", + "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + } + ], + "back": { + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "when_flag_clicked", + "message": "「when_flag_clicked」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "move", + "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + } + ] + } + }, + "ruby-1983a2aeae": { + "ja": "begin\n with_screen_refresh do\n move(2)\n end\nend while @a < 1", + "errors": [ + { + "line": 1, + "column": 1, + "id": "postTestLoop", + "message": "後判定の繰り返し(先に 1 回動かしてから条件を確かめる繰り返し)は日本語では書けません。最初の 1 回をループの前に書いてから、「〜の間繰り返す」にしてください。ルビータブでは書けます。" + }, + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "with_screen_refresh", + "message": "「with_screen_refresh」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 3, + "column": 5, + "id": "unsupportedCommand", + "name": "move", + "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 5, + "column": 1, + "id": "postTestLoop", + "message": "後判定の繰り返し(先に 1 回動かしてから条件を確かめる繰り返し)は日本語では書けません。最初の 1 回をループの前に書いてから、「〜の間繰り返す」にしてください。ルビータブでは書けます。" + } + ], + "back": { + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "postTestLoop", + "message": "後判定の繰り返し(先に 1 回動かしてから条件を確かめる繰り返し)は日本語では書けません。最初の 1 回をループの前に書いてから、「〜の間繰り返す」にしてください。ルビータブでは書けます。" + }, + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "with_screen_refresh", + "message": "「with_screen_refresh」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 3, + "column": 5, + "id": "unsupportedCommand", + "name": "move", + "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 5, + "column": 1, + "id": "postTestLoop", + "message": "後判定の繰り返し(先に 1 回動かしてから条件を確かめる繰り返し)は日本語では書けません。最初の 1 回をループの前に書いてから、「〜の間繰り返す」にしてください。ルビータブでは書けます。" + } + ] + } + }, + "ruby-b633dac76d": { + "ja": "a < 1 の間繰り返す:\n move(1) # what to do\n puts(\"#\") # do", + "errors": [ + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "move", + "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], + "back": { + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "move", + "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 3, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] + } + }, + "ruby-c14318c6c6": { + "ja": "a < 1 の間繰り返す:\n puts(\"do\")\n say(\"a do\", 1)", + "errors": [ + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + }, + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], + "back": { + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + }, + { + "line": 3, + "column": 5, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] + } + }, + "ruby-6da82361be": { + "ja": "関数 f(x):\n a < 1 の間繰り返す:\n loop do\n [1, 2].each do |y|\n if @a\n move(y)\n end\n end\n end", + "errors": [ + { + "line": 3, + "column": 5, + "id": "unsupportedCommand", + "name": "loop", + "message": "「loop」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 4, + "column": 14, + "id": "unsupportedCommand", + "name": "each", + "message": "「each」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 6, + "column": 11, + "id": "unsupportedCommand", + "name": "move", + "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + } + ], + "back": { + "ruby": null, + "errors": [ + { + "line": 3, + "column": 9, + "id": "unsupportedCommand", + "name": "loop", + "message": "「loop」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 4, + "column": 18, + "id": "unsupportedCommand", + "name": "each", + "message": "「each」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 5, + "column": 16, + "id": "forbiddenPrefix", + "name": "@", + "message": "日本語タブでは変数に「@」は使えません" + }, + { + "line": 6, + "column": 15, + "id": "unsupportedCommand", + "name": "move", + "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + } + ] + } + }, + "ruby-4aaad0975d": { + "ja": "a < 1 の間繰り返す:\n self.when(:clicked) do\n move(2)\n end", + "errors": [ + { + "line": 2, + "column": 8, + "id": "unsupportedCommand", + "name": "when", + "message": "「when」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 3, + "column": 5, + "id": "unsupportedCommand", + "name": "move", + "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + } + ], + "back": { + "ruby": null, + "errors": [ + { + "line": 2, + "column": 10, + "id": "unsupportedCommand", + "name": "when", + "message": "「when」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 3, + "column": 7, + "id": "unsupportedCommand", + "name": "move", + "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + } + ] + } + }, + "ruby-533fd2bdc7": { + "ja": "a < 1 の間繰り返す:\n with_screen_refresh do\n @b = 1\n end", + "errors": [ + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "with_screen_refresh", + "message": "「with_screen_refresh」は日本語タブでは書けない命令です。ルビータブでは書けます。" + } + ], + "back": { + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "with_screen_refresh", + "message": "「with_screen_refresh」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 3, + "column": 7, + "id": "forbiddenPrefix", + "name": "@", + "message": "日本語タブでは変数に「@」は使えません" + } + ] + } + }, + "ruby-7f4bb92f22": { + "ja": "a < 1 の間繰り返す:\n not x > 1 の間繰り返す:\n を繰り返す\n a = a + 1", + "errors": [], + "back": { + "ruby": "while @a < 1\n until @x > 1\n end\n @a = @a + 1\nend", + "errors": [] + } + }, + "ruby-6e43ecf036": { + "ja": "a < 1 の間繰り返す:\n when_flag_clicked do\n move(2)\n end", + "errors": [ + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "when_flag_clicked", + "message": "「when_flag_clicked」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 3, + "column": 5, + "id": "unsupportedCommand", + "name": "move", + "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + } + ], + "back": { + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "when_flag_clicked", + "message": "「when_flag_clicked」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 3, + "column": 7, + "id": "unsupportedCommand", + "name": "move", + "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + } + ] + } + }, + "ruby-2a0da5dba7": { + "ja": "a < 1 の間繰り返す:\n when_key_pressed(\"space\") do\n move(2)\n end", + "errors": [ + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "when_key_pressed", + "message": "「when_key_pressed」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 3, + "column": 5, + "id": "unsupportedCommand", + "name": "move", + "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + } + ], + "back": { + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "when_key_pressed", + "message": "「when_key_pressed」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 3, + "column": 7, + "id": "unsupportedCommand", + "name": "move", + "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + } + ] + } + }, + "ruby-9173ca31c6": { + "ja": "a = 0\nnot a > 10 の間繰り返す:\n a += 1", + "errors": [], + "back": { "ruby": "@a = 0\nuntil @a > 10\n @a += 1\nend", "errors": [] } @@ -1726,19 +2540,51 @@ } }, "ruby-2d36aba646": { - "ja": "表示する(namae + \"には「く」がある\")", - "errors": [], + "ja": "puts(namae + \"には「く」がある\")", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(@namae + \"には「く」がある\")", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-fc72d91bce": { - "ja": "表示する(\"「く」がある\")", - "errors": [], + "ja": "puts(\"「く」がある\")", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(\"「く」がある\")", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-26e711ac71": { @@ -1766,19 +2612,51 @@ } }, "ruby-9eb75f7825": { - "ja": "next = 1\nnext < 10 の間繰り返す:\n next += 1\nbreak を 1 から 3 まで 1 ずつ増やしながら繰り返す:\n 表示する(break)\nnext == 1", - "errors": [], + "ja": "next = 1\nnext < 10 の間繰り返す:\n next += 1\nbreak を 1 から 3 まで 1 ずつ増やしながら繰り返す:\n puts(break)\nnext == 1", + "errors": [ + { + "line": 7, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@next = 1\nwhile @next < 10\n @next += 1\nend\n@break = 1\nwhile @break <= 3\n console.puts(@break)\n @break += 1\nend\n@next == 1", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 5, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-4eeec74912": { - "ja": "next = 1\nbreak = next + 1\nnext += break\n表示する(next)", - "errors": [], + "ja": "next = 1\nbreak = next + 1\nnext += break\nputs(next)", + "errors": [ + { + "line": 4, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@next = 1\n@break = @next + 1\n@next += @break\nconsole.puts(@next)", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 4, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-b26155f79f": { @@ -1851,7 +2729,7 @@ } }, "ruby-f5152fd5b3": { - "ja": "i = 0\ni < 10 の間繰り返す:\n i += 1\n next unless @i > 5\n 表示する(i)", + "ja": "i = 0\ni < 10 の間繰り返す:\n i += 1\n next unless @i > 5\n puts(i)", "errors": [ { "line": 4, @@ -1866,6 +2744,13 @@ "id": "unsupportedNotation", "name": "unless", "message": "「unless」は日本語タブでは書けません。ルビータブでは書けます。" + }, + { + "line": 5, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ], "back": { @@ -1912,7 +2797,7 @@ } }, "ruby-9fcce08e32": { - "ja": "h = {}\n表示する(h[:a])", + "ja": "h = {}\nputs(h[:a])", "errors": [ { "line": 1, @@ -1921,6 +2806,13 @@ "name": "{}", "message": "「{}」は日本語タブでは書けません。ルビータブでは書けます。" }, + { + "line": 2, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + }, { "line": 2, "column": 9, @@ -1932,15 +2824,12 @@ "back": { "ruby": null, "errors": [ - { - "line": 1, - "column": 5, - "message": "「{」が読めません" - }, { "line": 2, - "column": 8, - "message": "「:」が読めません" + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ] } @@ -1948,6 +2837,13 @@ "ruby-6c853477e1": { "ja": "puts(1) unless @x", "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + }, { "line": 1, "column": 9, @@ -1978,6 +2874,13 @@ "id": "unsupportedNotation", "name": "case", "message": "「case」は日本語タブでは書けません。ルビータブでは書けます。" + }, + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ], "back": { @@ -1989,6 +2892,13 @@ "id": "forbiddenPrefix", "name": "@", "message": "日本語タブでは変数に「@」は使えません" + }, + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ] } @@ -2105,11 +3015,27 @@ } }, "ruby-c1afea4390": { - "ja": "表示する(\"017\")", - "errors": [], + "ja": "puts(\"017\")", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(\"017\")", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-dc5f09ac8b": { @@ -2185,16 +3111,39 @@ } }, "ruby-1a508f0d78": { - "ja": "a = 1.5\n表示する(\"0x5\")\nb = 文字列(1) # 1e3", - "errors": [], + "ja": "a = 1.5\nputs(\"0x5\")\nb = 文字列(1) # 1e3", + "errors": [ + { + "line": 2, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@a = 1.5\nconsole.puts(\"0x5\")\n@b = 1.to_s # 1e3", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-58f23a4a46": { - "ja": "表示する(0b101)", + "ja": "puts(0b101)", "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + }, { "line": 1, "column": 6, @@ -2217,8 +3166,15 @@ } }, "ruby-ae927b97f8": { - "ja": "a = 1\n表示する(a)\nb = 1e3", + "ja": "a = 1\nputs(a)\nb = 1e3", "errors": [ + { + "line": 2, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + }, { "line": 3, "column": 6, @@ -2407,6 +3363,20 @@ "ruby-2e9e8bada2": { "ja": "x = ask(\"\")\nx = answer\nbegin\n @a = @a + 1\nend until @a >= 3", "errors": [ + { + "line": 1, + "column": 6, + "id": "unsupportedCommand", + "name": "ask", + "message": "「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。" + }, + { + "line": 2, + "column": 6, + "id": "unsupportedCommand", + "name": "answer", + "message": "「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。" + }, { "line": 3, "column": 1, @@ -2462,19 +3432,51 @@ } }, "ruby-658999bfe3": { - "ja": "i を 1 から 10 まで 1 ずつ増やしながら繰り返す:\n 表示する(i)", - "errors": [], + "ja": "i を 1 から 10 まで 1 ずつ増やしながら繰り返す:\n puts(i)", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 1\nwhile @i <= 10\n console.puts(@i)\n @i += 1\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-7c3d4a151e": { - "ja": "i を 10 から 0 まで 1 ずつ減らしながら繰り返す:\n 表示する(i)", - "errors": [], + "ja": "i を 10 から 0 まで 1 ずつ減らしながら繰り返す:\n puts(i)", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 10\nwhile @i >= 0\n console.puts(@i)\n @i += -1\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-7d9eff81cc": { @@ -2494,59 +3496,171 @@ } }, "ruby-2eb0608b25": { - "ja": "表示する(乱数(1..10) + 5)", - "errors": [], + "ja": "puts(乱数(1..10) + 5)", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(rand(1..10) + 5)", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-07a67412bc": { - "ja": "表示する(乱数(1..10))", - "errors": [], + "ja": "puts(乱数(1..10))", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(rand(1..10))", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-ecaff604c6": { - "ja": "表示する(整数(x))", - "errors": [], + "ja": "puts(整数(x))", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(@x.to_i)", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-ed8c543996": { - "ja": "表示する(絶対値(x))", - "errors": [], + "ja": "puts(絶対値(x))", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(@x.abs)", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-36e67b9821": { - "ja": "表示する(整数(x))", - "errors": [], + "ja": "say(整数(x), 1)", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(@x.to_i)", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-2a2b54cea0": { - "ja": "表示する(乱数(1..10) + 5)", - "errors": [], + "ja": "say(乱数(1..10) + 5, 1)", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(rand(1..10) + 5)", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-2cf24538ea": { - "ja": "表示する(乱数(1..10))", - "errors": [], + "ja": "say(乱数(1..10), 1)", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(rand(1..10))", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-231463adce": { @@ -2566,27 +3680,75 @@ } }, "ruby-c7d88b1360": { - "ja": "表示する(変数 + \"バナナ\")", - "errors": [], + "ja": "say(変数 + \"バナナ\", 2)", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(@変数 + \"バナナ\")", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-ff724274a8": { - "ja": "表示する(a, \"x\", b)", - "errors": [], + "ja": "say(文字列(a) + \"x\" + 文字列(b), 3)", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(@a.to_s + \"x\" + @b.to_s)", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-4182ed5257": { - "ja": "表示する(\"\\\"x←1\")", - "errors": [], + "ja": "puts(\"\\\"x←1\")", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(\"\\\"x←1\")", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-68f02ecfe3": { @@ -2598,11 +3760,27 @@ } }, "ruby-aef6dd3674": { - "ja": "表示する(\"a\\\\b\")", - "errors": [], + "ja": "puts(\"a\\\\b\")", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(\"a\\\\b\")", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-3767102b20": { @@ -2646,107 +3824,343 @@ } }, "ruby-51f023929a": { - "ja": "表示する(含む(a, \"x.include?(y)\"))", - "errors": [], + "ja": "puts(含む(a, \"x.include?(y)\"))", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(@a.include?(\"x.include?(y)\"))", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-7c40a7dd98": { - "ja": "表示する(含む(\"abc\", \"b\"))", - "errors": [], + "ja": "puts(含む(\"abc\", \"b\"))", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(\"abc\".include?(\"b\"))", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-95efd5952e": { - "ja": "表示する('a.include?(b)')", - "errors": [], + "ja": "puts('a.include?(b)')", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts('a.include?(b)')", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-7c9cf205bc": { - "ja": "表示する(\"a && b || c\")", - "errors": [], + "ja": "puts(\"a && b || c\")", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(\"a && b || c\")", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-8b7144e773": { - "ja": "表示する(\"a.include?(b)\")", - "errors": [], + "ja": "puts(\"a.include?(b)\")", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(\"a.include?(b)\")", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-387f30b057": { - "ja": "表示する(\"rand(3)\")", - "errors": [], + "ja": "puts(\"rand(3)\")", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(\"rand(3)\")", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-880093b718": { - "ja": "表示する(\"true false\")", - "errors": [], + "ja": "puts(\"true false\")", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(\"true false\")", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-2077d6f8a5": { - "ja": "表示する(\"x = 1\")", - "errors": [], + "ja": "puts(\"x = 1\")", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(\"x = 1\")", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-e869f18661": { - "ja": "表示する(\"x.to_i\")", - "errors": [], + "ja": "puts(\"x.to_i\")", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(\"x.to_i\")", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-5cd44d0965": { - "ja": "もし a == \"#\" ならば: # c\n 表示する(a)", - "errors": [], + "ja": "もし a == \"#\" ならば: # c\n puts(a)", + "errors": [ + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "if @a == \"#\" # c\n console.puts(@a)\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-3f4ace887d": { - "ja": "# はじめ\nもし a > 0 ならば: # c\n # なか\n 表示する(a)\nを実行する\n# おわり", - "errors": [], + "ja": "# はじめ\nもし a > 0 ならば: # c\n # なか\n puts(a)\nを実行する\n# おわり", + "errors": [ + { + "line": 4, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "# はじめ\nif @a > 0 # c\n # なか\n console.puts(@a)\nend\n# おわり", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 4, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-9b9e548db4": { - "ja": "i を 1 から 3 まで 1 ずつ増やしながら繰り返す: # c\n 表示する(i)\nを繰り返す # d", - "errors": [], + "ja": "i を 1 から 3 まで 1 ずつ増やしながら繰り返す: # c\n puts(i)\nを繰り返す # d", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 1\nwhile @i <= 3 # c\n console.puts(@i)\n @i += 1\nend # d", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-60da6f11c5": { - "ja": "もし a > 0 ならば: # c1\n 表示する(a)\nそうでなくもし a < 0 ならば: # c2\n 表示する(b)\nそうでなければ: # c3\n 表示する(c)\nを実行する # c4", - "errors": [], + "ja": "もし a > 0 ならば: # c1\n puts(a)\nそうでなくもし a < 0 ならば: # c2\n puts(b)\nそうでなければ: # c3\n puts(c)\nを実行する # c4", + "errors": [ + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + }, + { + "line": 4, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + }, + { + "line": 6, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "if @a > 0 # c1\n console.puts(@a)\nelsif @a < 0 # c2\n console.puts(@b)\nelse # c3\n console.puts(@c)\nend # c4", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + }, + { + "line": 4, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + }, + { + "line": 6, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-4f97f20639": { @@ -2758,101 +4172,266 @@ } }, "ruby-fe55ee722c": { - "ja": "もし a > 0 ならば:\n 表示する(a)\nを実行する # c", - "errors": [], + "ja": "もし a > 0 ならば:\n puts(a)\nを実行する # c", + "errors": [ + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "if @a > 0\n console.puts(@a)\nend # c", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-04fb04bc33": { - "ja": "もし a > 0 ならば: # c\n 表示する(a)", - "errors": [], + "ja": "もし a > 0 ならば: # c\n puts(a)", + "errors": [ + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "if @a > 0 # c\n console.puts(@a)\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-2fee7980cb": { - "ja": "x = 【外部からの入力】 # c", - "errors": [], + "ja": "ask(\"\")\nx = answer # c", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "ask", + "message": "「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。" + }, + { + "line": 2, + "column": 6, + "id": "unsupportedCommand", + "name": "answer", + "message": "「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。" + } + ], "back": { - "ruby": "@x = console.gets # c", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "ask", + "message": "「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。" + } + ] } }, "ruby-20e60df7bd": { - "ja": "a < 3 の間繰り返す: # loop\n もし a > 1 ならば: # if\n 表示する(a)\n を実行する # end if\n a = a + 1 # step\nを繰り返す # end loop", - "errors": [], + "ja": "a < 3 の間繰り返す: # loop\n もし a > 1 ならば: # if\n puts(a)\n を実行する # end if\n a = a + 1 # step\nを繰り返す # end loop", + "errors": [ + { + "line": 3, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "while @a < 3 # loop\n if @a > 1 # if\n console.puts(@a)\n end # end if\n @a = @a + 1 # step\nend # end loop", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 3, + "column": 9, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-1d1ca8d69a": { - "ja": "表示する(1) # move(2)", - "errors": [], + "ja": "puts(1) # move(2)", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(1) # move(2)", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-72a937ee53": { "ja": "i を 1 から 3 まで 1 ずつ増やしながら繰り返す: # a # b\nを繰り返す # c # d\nmove(2) # e", "errors": [ { - "line": 5, + "line": 5, + "column": 1, + "id": "unsupportedCommand", + "name": "move", + "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + } + ], + "back": { + "ruby": null, + "errors": [ + { + "line": 3, + "column": 1, + "id": "unsupportedCommand", + "name": "move", + "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + } + ] + } + }, + "ruby-472e25dad1": { + "ja": "i を 1 から 3 まで 1 ずつ増やしながら繰り返す: # a # b\n puts(i) # p\nを繰り返す # inc # e", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], + "back": { + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] + } + }, + "ruby-dddf8c4e71": { + "ja": "i を 1 から 3 まで 1 ずつ増やしながら繰り返す: # a # b\n puts(i) # p\nを繰り返す # inc # e", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], + "back": { + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] + } + }, + "ruby-0dae47428d": { + "ja": "ask(\"\")\nx = answer # q # a", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "ask", + "message": "「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。" + }, + { + "line": 2, + "column": 6, + "id": "unsupportedCommand", + "name": "answer", + "message": "「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。" + } + ], + "back": { + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "ask", + "message": "「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。" + } + ] + } + }, + "ruby-4377582ea1": { + "ja": "ask(\"\") # q\nx = answer # a", + "errors": [ + { + "line": 1, "column": 1, "id": "unsupportedCommand", - "name": "move", - "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + "name": "ask", + "message": "「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。" + }, + { + "line": 2, + "column": 6, + "id": "unsupportedCommand", + "name": "answer", + "message": "「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。" } ], "back": { "ruby": null, "errors": [ { - "line": 3, + "line": 1, "column": 1, "id": "unsupportedCommand", - "name": "move", - "message": "「move」は日本語タブでは書けない命令です。ルビータブでは書けます。" + "name": "ask", + "message": "「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。" } ] } }, - "ruby-472e25dad1": { - "ja": "i を 1 から 3 まで 1 ずつ増やしながら繰り返す: # a # b\n 表示する(i) # p\nを繰り返す # inc # e", - "errors": [], - "back": { - "ruby": "@i = 1\nwhile @i <= 3 # a # b\n console.puts(@i) # p\n @i += 1\nend # inc # e", - "errors": [] - } - }, - "ruby-dddf8c4e71": { - "ja": "i を 1 から 3 まで 1 ずつ増やしながら繰り返す: # a # b\n 表示する(i) # p\nを繰り返す # inc # e", - "errors": [], - "back": { - "ruby": "@i = 1\nwhile @i <= 3 # a # b\n console.puts(@i) # p\n @i += 1\nend # inc # e", - "errors": [] - } - }, - "ruby-0dae47428d": { - "ja": "x = 【外部からの入力】 # q # a", - "errors": [], - "back": { - "ruby": "@x = console.gets # q # a", - "errors": [] - } - }, - "ruby-4377582ea1": { - "ja": "x = 【外部からの入力】 # q # a", - "errors": [], - "back": { - "ruby": "@x = console.gets # q # a", - "errors": [] - } - }, "ruby-5215e56679": { "ja": "a < 3 の間繰り返す: # c\n a = a + 1\nを繰り返す # d", "errors": [], @@ -2870,27 +4449,75 @@ } }, "ruby-4d44dd4e74": { - "ja": "関数 あいさつ():\n 表示する(\"こんにちは\")\nあいさつ()", - "errors": [], + "ja": "関数 あいさつ():\n puts(\"こんにちは\")\nあいさつ()", + "errors": [ + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "def あいさつ()\n console.puts(\"こんにちは\")\nend\nあいさつ()", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-c2470cd865": { - "ja": "関数 greet():\n 表示する(\"hi\")\ngreet", - "errors": [], + "ja": "関数 greet():\n puts(\"hi\")\ngreet", + "errors": [ + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "def greet()\n console.puts(\"hi\")\nend\ngreet", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-4e74e19313": { - "ja": "move = 1\n表示する(move)", - "errors": [], + "ja": "move = 1\nputs(move)", + "errors": [ + { + "line": 2, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@move = 1\nconsole.puts(@move)", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-3ef3655316": { @@ -2978,7 +4605,7 @@ } }, "ruby-9716caf4c3": { - "ja": "もし key_pressed?(\"space\") ならば:\n 表示する(1)", + "ja": "もし key_pressed?(\"space\") ならば:\n puts(1)", "errors": [ { "line": 1, @@ -2986,6 +4613,13 @@ "id": "unsupportedCommand", "name": "key_pressed?", "message": "「key_pressed?」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ], "back": { @@ -2997,16 +4631,53 @@ "id": "unsupportedCommand", "name": "key_pressed?", "message": "「key_pressed?」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ] } }, "ruby-60b44a062e": { - "ja": "x = 10\n表示する(\"hello\")\n表示する(乱数(1..6))", - "errors": [], + "ja": "x = 10\nsay(\"hello\", 1)\nputs(乱数(1..6))", + "errors": [ + { + "line": 2, + "column": 1, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + }, + { + "line": 3, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@x = 10\nconsole.puts(\"hello\")\nconsole.puts(rand(1..6))", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 1, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + }, + { + "line": 3, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-b7c07e7a0c": { @@ -3305,6 +4976,13 @@ "id": "unsupportedCommand", "name": "when_clicked", "message": "「when_clicked」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ], "back": { @@ -3316,6 +4994,13 @@ "id": "unsupportedCommand", "name": "when_clicked", "message": "「when_clicked」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ] } @@ -3329,6 +5014,13 @@ "id": "unsupportedCommand", "name": "when_flag_clicked", "message": "「when_flag_clicked」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ], "back": { @@ -3340,6 +5032,13 @@ "id": "unsupportedCommand", "name": "when_flag_clicked", "message": "「when_flag_clicked」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ] } @@ -3353,6 +5052,13 @@ "id": "unsupportedCommand", "name": "when_key_pressed", "message": "「when_key_pressed」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ], "back": { @@ -3364,24 +5070,63 @@ "id": "unsupportedCommand", "name": "when_key_pressed", "message": "「when_key_pressed」は日本語タブでは書けない命令です。ルビータブでは書けます。" + }, + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" } ] } }, "ruby-a63e74fb43": { - "ja": "x = 10\n表示する(\"hello\")\n", - "errors": [], + "ja": "x = 10\nsay(\"hello\", 1)\n", + "errors": [ + { + "line": 2, + "column": 1, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@x = 10\nconsole.puts(\"hello\")\n", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 1, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-9c85040659": { - "ja": "x = 10\nもし x > 5 ならば:\n 表示する(\"big\")\n", - "errors": [], + "ja": "x = 10\nもし x > 5 ならば:\n say(\"big\", 1)\n", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@x = 10\nif @x > 5\n console.puts(\"big\")\nend\n", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 3, + "column": 5, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-0c9195f1d2": { @@ -3521,19 +5266,51 @@ } }, "ruby-cb7c62d16c": { - "ja": "回数 を 1 から 5 まで 1 ずつ増やしながら繰り返す:\n 表示する(回数)", - "errors": [], + "ja": "回数 を 1 から 5 まで 1 ずつ増やしながら繰り返す:\n say(回数, 1)", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@回数 = 1\nwhile @回数 <= 5\n console.puts(@回数)\n @回数 += 1\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-6ca50474fe": { - "ja": "合計 = 0\ni を 1 から 10 まで 1 ずつ増やしながら繰り返す:\n 合計 += i\n表示する(合計)", - "errors": [], + "ja": "合計 = 0\ni を 1 から 10 まで 1 ずつ増やしながら繰り返す:\n 合計 += i\nsay(合計, 1)", + "errors": [ + { + "line": 7, + "column": 1, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@合計 = 0\n@i = 1\nwhile @i <= 10\n @合計 += @i\n @i += 1\nend\nconsole.puts(@合計)", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 4, + "column": 1, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-931705aea0": { @@ -3601,51 +5378,147 @@ } }, "ruby-49f0a595c1": { - "ja": "i を 1 から 10 まで 1 ずつ増やしながら繰り返す:\n 表示する(i)", - "errors": [], + "ja": "i を 1 から 10 まで 1 ずつ増やしながら繰り返す:\n say(i, 1)", + "errors": [ + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 1\nwhile @i <= 10\n console.puts(@i)\n @i += 1\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-48a6e1d3b2": { - "ja": "i を 10 から 0 まで 1 ずつ減らしながら繰り返す:\n 表示する(i)", - "errors": [], + "ja": "i を 10 から 0 まで 1 ずつ減らしながら繰り返す:\n say(i, 1)", + "errors": [ + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 10\nwhile @i >= 0\n console.puts(@i)\n @i += -1\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-144d02d4bf": { - "ja": "i を 1 から 10 まで 1 ずつ増やしながら繰り返す:\n 表示する(i)", - "errors": [], + "ja": "i を 1 から 10 まで 1 ずつ増やしながら繰り返す:\n say(i, 1)", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 1\nwhile @i <= 10\n console.puts(@i)\n @i += 1\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-001b1ca44e": { - "ja": "i を 0 から n まで 2 ずつ増やしながら繰り返す:\n 表示する(i)", - "errors": [], + "ja": "i を 0 から n まで 2 ずつ増やしながら繰り返す:\n say(i, 1)", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 0\nwhile @i <= @n\n console.puts(@i)\n @i += 2\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-f8540561d0": { - "ja": "i を 10 から 0 まで 1 ずつ減らしながら繰り返す:\n 表示する(i)", - "errors": [], + "ja": "i を 10 から 0 まで 1 ずつ減らしながら繰り返す:\n say(i, 1)", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 10\nwhile @i >= 0\n console.puts(@i)\n @i += -1\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-56bd6a584b": { - "ja": "i を 1 から 3 まで 1 ずつ増やしながら繰り返す:\n j を 1 から 3 まで 1 ずつ増やしながら繰り返す:\n 表示する(i)", - "errors": [], + "ja": "i を 1 から 3 まで 1 ずつ増やしながら繰り返す:\n j を 1 から 3 まで 1 ずつ増やしながら繰り返す:\n say(i, 1)", + "errors": [ + { + "line": 5, + "column": 5, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 1\nwhile @i <= 3\n @j = 1\n while @j <= 3\n console.puts(@i)\n @j += 1\n end\n @i += 1\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 3, + "column": 9, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-22ff6f6ae1": { @@ -3721,83 +5594,264 @@ } }, "ruby-c7861c0594": { - "ja": "a = 【外部からの入力】", - "errors": [], + "ja": "ask(\"\")\na = answer", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "ask", + "message": "「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。" + }, + { + "line": 2, + "column": 6, + "id": "unsupportedCommand", + "name": "answer", + "message": "「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。" + } + ], "back": { - "ruby": "@a = console.gets", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "ask", + "message": "「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。" + } + ] } }, "ruby-05cb2fad0a": { - "ja": "n = 【整数を入力】", - "errors": [], + "ja": "ask(\"\")\nn = 整数(answer)", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "ask", + "message": "「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。" + }, + { + "line": 2, + "column": 6, + "id": "unsupportedCommand", + "name": "answer", + "message": "「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。" + } + ], "back": { - "ruby": "@n = console.gets.to_i", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "ask", + "message": "「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。" + } + ] } }, "ruby-8422e45088": { - "ja": "a = 【外部からの入力】", - "errors": [], + "ja": "ask_and_wait(\"\")\na = answer", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "ask_and_wait", + "message": "「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。" + }, + { + "line": 2, + "column": 6, + "id": "unsupportedCommand", + "name": "answer", + "message": "「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。" + } + ], "back": { - "ruby": "@a = console.gets", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "ask_and_wait", + "message": "「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。" + } + ] } }, "ruby-cbc736d277": { - "ja": "表示する(a)", - "errors": [], + "ja": "p(a)", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "p", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(@a)", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "p", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-2a47cf172b": { - "ja": "表示する(a)", - "errors": [], + "ja": "print(a)", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "print", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(@a)", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "print", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-7c8d155ded": { - "ja": "表示する(a)", - "errors": [], + "ja": "puts(a)", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(@a)", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-76b592ca14": { - "ja": "表示する(a)", - "errors": [], + "ja": "say(a, 1)", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(@a)", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-a21298923f": { - "ja": "表示する(a, b, c)", - "errors": [], + "ja": "say(a, b, c, 1)", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(@a.to_s + @b.to_s + @c.to_s)", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-642afbeca7": { - "ja": "表示する(a)", - "errors": [], + "ja": "say(a, 0.5)", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(@a)", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-d63c113b17": { - "ja": "表示する(a)", - "errors": [], + "ja": "say(a, 2)", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(@a)", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-bed971a784": { @@ -3833,35 +5887,127 @@ } }, "ruby-4ac041d396": { - "ja": "表示する(表示する(x))", - "errors": [], + "ja": "p(p(x))", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "p", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + }, + { + "line": 1, + "column": 3, + "id": "unsupportedCommand", + "name": "p", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(console.puts(@x))", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "p", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + }, + { + "line": 1, + "column": 3, + "id": "unsupportedCommand", + "name": "p", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-6e3123c670": { - "ja": "表示する(表示する(x))", - "errors": [], + "ja": "puts(puts(x))", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + }, + { + "line": 1, + "column": 6, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(console.puts(@x))", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + }, + { + "line": 1, + "column": 6, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-3235f43023": { - "ja": "表示する(乱数(乱数(乱数(1..10))))", - "errors": [], + "ja": "puts(乱数(乱数(乱数(1..10))))", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(rand(rand(rand(1..10))))", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-1496e444fc": { - "ja": "表示する(乱数(乱数(1..10)))", - "errors": [], + "ja": "say(乱数(乱数(1..10)), 1)", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(rand(rand(1..10)))", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "say", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-3f89cf26c3": { @@ -3961,11 +6107,27 @@ } }, "ruby-424f214fbb": { - "ja": "佐々木 = 7\n表示する(佐々木)", - "errors": [], + "ja": "佐々木 = 7\nputs(佐々木)", + "errors": [ + { + "line": 2, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@佐々木 = 7\nconsole.puts(@佐々木)", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-bb37969227": { @@ -4009,27 +6171,89 @@ } }, "ruby-54ff0e8e7d": { - "ja": "表示する(x)", - "errors": [], + "ja": "puts(x)", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(@x)", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-6ef00f586a": { - "ja": "もし x > 0 ならば:\n 表示する(x)", - "errors": [], + "ja": "もし x > 0 ならば:\n puts(x)", + "errors": [ + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "if @x > 0\n console.puts(@x)\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-61c7f55e11": { - "ja": "もし x > 0 ならば:\n 表示する(x)\nそうでなければ:\n 表示する(y)", - "errors": [], + "ja": "もし x > 0 ならば:\n puts(x)\nそうでなければ:\n puts(y)", + "errors": [ + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + }, + { + "line": 4, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "if @x > 0\n console.puts(@x)\nelse\n console.puts(@y)\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + }, + { + "line": 4, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-6fc293d44c": { @@ -4049,19 +6273,51 @@ } }, "ruby-079cddd189": { - "ja": "i を 3 から 1 まで 1 ずつ減らしながら繰り返す:\n 表示する(i)", - "errors": [], + "ja": "i を 3 から 1 まで 1 ずつ減らしながら繰り返す:\n puts(i)", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 3\nwhile @i >= 1\n console.puts(@i)\n @i += -1\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-d064a45827": { - "ja": "i を 1 から 3 まで 1 ずつ増やしながら繰り返す:\n 表示する(i)", - "errors": [], + "ja": "i を 1 から 3 まで 1 ずつ増やしながら繰り返す:\n puts(i)", + "errors": [ + { + "line": 3, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "@i = 1\nwhile @i <= 3\n console.puts(@i)\n @i += 1\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-1b6c2e6ab5": { @@ -4089,11 +6345,34 @@ } }, "ruby-d1a9c0ec96": { - "ja": "x = 【外部からの入力】", - "errors": [], + "ja": "ask(\"\")\nx = answer", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "ask", + "message": "「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。" + }, + { + "line": 2, + "column": 6, + "id": "unsupportedCommand", + "name": "answer", + "message": "「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。" + } + ], "back": { - "ruby": "@x = console.gets", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "ask", + "message": "「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。" + } + ] } }, "ruby-a22ccc3dea": { @@ -4105,11 +6384,27 @@ } }, "ruby-3cd5f2d94e": { - "ja": "もし x > 0 and x < 9 ならば:\n 表示する(x)", - "errors": [], + "ja": "もし x > 0 and x < 9 ならば:\n puts(x)", + "errors": [ + { + "line": 2, + "column": 3, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "if @x > 0 && @x < 9\n console.puts(@x)\nend", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 2, + "column": 5, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-db39dd4f47": { @@ -4129,11 +6424,27 @@ } }, "ruby-74967b1eaa": { - "ja": "表示する(\"合計\", x)", - "errors": [], + "ja": "puts(\"合計\" + 文字列(x))", + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ], "back": { - "ruby": "console.puts(\"合計\" + @x.to_s)", - "errors": [] + "ruby": null, + "errors": [ + { + "line": 1, + "column": 1, + "id": "unsupportedCommand", + "name": "puts", + "message": "「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。" + } + ] } }, "ruby-2b1c082691": { diff --git a/packages/scratch-gui/test/unit/lib/dncl/dncl-bare-method-in-expression.test.js b/packages/scratch-gui/test/unit/lib/dncl/dncl-bare-method-in-expression.test.js index d3e7cc64078..f3f338e428c 100644 --- a/packages/scratch-gui/test/unit/lib/dncl/dncl-bare-method-in-expression.test.js +++ b/packages/scratch-gui/test/unit/lib/dncl/dncl-bare-method-in-expression.test.js @@ -5,7 +5,7 @@ * variable instead (issue #1694). The Japanese mode cannot tell it from a * variable, so Ruby → DNCL stops on it with the unsupported command error. * Ruby's local variables (assigned, block and method parameters) and the - * names the Japanese mode has (`answer`, `rand`, ...) are not taken. + * names the Japanese mode has (`rand`, ...) are not taken. */ import { UNSUPPORTED_COMMAND_ERROR_ID } from '../../../../src/lib/dncl/dncl-validator'; import { rubyToDncl } from '../../../../src/lib/dncl/ruby-to-dncl'; @@ -26,20 +26,22 @@ describe('Ruby → DNCL: a method without parentheses in an expression (issue #1 }); test('a method in an argument', () => { - expect(rubyErrors('puts(costume_number)')).toEqual([{ line: 1, column: 6, name: 'costume_number' }]); + expect(rubyErrors('console.puts(costume_number)')).toEqual([{ line: 1, column: 14, name: 'costume_number' }]); }); test('a method in a condition and with a method of its value', () => { - expect(rubyErrors(lines('if direction > 90', ' puts(y_position.to_s)', 'end'))).toEqual([ + expect(rubyErrors(lines('if direction > 90', ' console.puts(y_position.to_s)', 'end'))).toEqual([ { line: 1, column: 4, name: 'direction' }, - { line: 2, column: 8, name: 'y_position' }, + { line: 2, column: 16, name: 'y_position' }, ]); }); test('a method in the bound or the step of a counting loop', () => { // The `while` and the increment are written in the header made from `@i = 1`. expect( - rubyErrors(lines('@i = 1', 'while @i <= x_position', ' puts(@i)', ' @i += costume_number', 'end')), + rubyErrors( + lines('@i = 1', 'while @i <= x_position', ' console.puts(@i)', ' @i += costume_number', 'end'), + ), ).toEqual([ { line: 2, column: 13, name: 'x_position' }, { line: 4, column: 9, name: 'costume_number' }, @@ -57,7 +59,7 @@ describe('Ruby → DNCL: a method without parentheses in an expression (issue #1 }); test('a name in a string or a comment is not taken', () => { - expect(rubyErrors(lines('puts("x_position")', '@a = 1 # x_position'))).toEqual([]); + expect(rubyErrors(lines('console.puts("x_position")', '@a = 1 # x_position'))).toEqual([]); }); }); @@ -67,7 +69,7 @@ describe('Ruby → DNCL: names that stay as they are (issue #1694)', () => { }); test('Ruby local variables assigned together', () => { - expect(rubyErrors(lines('a, b = 1, 2', 'puts(a + b)'))).toEqual([]); + expect(rubyErrors(lines('a, b = 1, 2', 'console.puts(a + b)'))).toEqual([]); }); test('a method parameter', () => { @@ -75,23 +77,22 @@ describe('Ruby → DNCL: names that stay as they are (issue #1694)', () => { }); test('a block parameter', () => { - const errors = rubyErrors(lines('(1..3).step(1) do |i|', ' puts(i)', 'end')); + const errors = rubyErrors(lines('(1..3).step(1) do |i|', ' console.puts(i)', 'end')); expect(errors).toEqual([]); }); test('a defined function called without parentheses', () => { - expect(rubyErrors(lines('def greet', ' puts("hi")', 'end', '@a = greet'))).toEqual([]); + expect(rubyErrors(lines('def greet', ' console.puts("hi")', 'end', '@a = greet'))).toEqual([]); }); - test('answer, rand and the built-in functions', () => { + test('console.gets, rand and the built-in functions', () => { expect( rubyErrors( lines( - 'ask("")', - '@a = answer', + '@a = console.gets', '@b = rand(1..6)', '@c = @a.to_i + @b.length', - 'puts(true && !false)', + 'console.puts(true && !false)', ), ), ).toEqual([]); diff --git a/packages/scratch-gui/test/unit/lib/dncl/dncl-block-filter.test.js b/packages/scratch-gui/test/unit/lib/dncl/dncl-block-filter.test.js index 43614bdc8e2..ad0b5e562d0 100644 --- a/packages/scratch-gui/test/unit/lib/dncl/dncl-block-filter.test.js +++ b/packages/scratch-gui/test/unit/lib/dncl/dncl-block-filter.test.js @@ -28,15 +28,15 @@ describe('isDnclAllowedBlock', () => { expect(isDnclAllowedBlock('control_stop')).toBe(false); }); - test('allows looks_sayforsecs (表示する) but not looks_say or looks_show', () => { - expect(isDnclAllowedBlock('looks_sayforsecs')).toBe(true); + test('rejects the looks blocks, also the say block (#2623)', () => { + expect(isDnclAllowedBlock('looks_sayforsecs')).toBe(false); expect(isDnclAllowedBlock('looks_say')).toBe(false); expect(isDnclAllowedBlock('looks_show')).toBe(false); }); - test('allows sensing_askandwait (【外部からの入力】) but not sensing_touchingobject', () => { - expect(isDnclAllowedBlock('sensing_askandwait')).toBe(true); - expect(isDnclAllowedBlock('sensing_answer')).toBe(true); + test('rejects the sensing blocks, also ask and answer (#2623)', () => { + expect(isDnclAllowedBlock('sensing_askandwait')).toBe(false); + expect(isDnclAllowedBlock('sensing_answer')).toBe(false); expect(isDnclAllowedBlock('sensing_touchingobject')).toBe(false); }); @@ -74,6 +74,11 @@ describe('isDnclHiddenCategory', () => { expect(isDnclHiddenCategory('events')).toBe(true); }); + test('hides looks and sensing categories (#2623)', () => { + expect(isDnclHiddenCategory('looks')).toBe(true); + expect(isDnclHiddenCategory('sensing')).toBe(true); + }); + test('does not hide control', () => { expect(isDnclHiddenCategory('control')).toBe(false); }); diff --git a/packages/scratch-gui/test/unit/lib/dncl/dncl-display-multi-arg.test.js b/packages/scratch-gui/test/unit/lib/dncl/dncl-display-multi-arg.test.js index a44991d0f79..0e9f90d0573 100644 --- a/packages/scratch-gui/test/unit/lib/dncl/dncl-display-multi-arg.test.js +++ b/packages/scratch-gui/test/unit/lib/dncl/dncl-display-multi-arg.test.js @@ -107,18 +107,13 @@ describe('Ruby → DNCL: console.puts(...) flatten + .to_s unwrap', () => { }); }); -describe('Ruby → DNCL: say(...) flatten too (for backward compat)', () => { - test('say(@a, 1) → 表示する(a) (existing behavior)', () => { - expect(rToD('say(@a, 1)')).toBe('表示する(a)'); - }); - - test('say("a" + "b" + "c", 1) → 表示する("a", "b", "c") (NEW: flatten)', () => { - expect(rToD('say("a" + "b" + "c", 1)')).toBe('表示する("a", "b", "c")'); +describe('Ruby → DNCL: console.puts(...) flatten', () => { + test('console.puts(@a) → 表示する(a)', () => { + expect(rToD('console.puts(@a)')).toBe('表示する(a)'); }); - test('say(@a, @b, @c, 1) → 表示する(a, b, c) (existing multi-arg comma form)', () => { - // This existing pre-flatten form still works for backward compatibility - expect(rToD('say(@a, @b, @c, 1)')).toBe('表示する(a, b, c)'); + test('console.puts("a" + "b" + "c") → 表示する("a", "b", "c")', () => { + expect(rToD('console.puts("a" + "b" + "c")')).toBe('表示する("a", "b", "c")'); }); }); diff --git a/packages/scratch-gui/test/unit/lib/dncl/dncl-do-block.test.js b/packages/scratch-gui/test/unit/lib/dncl/dncl-do-block.test.js index 54e61c583c9..0c2824b5d92 100644 --- a/packages/scratch-gui/test/unit/lib/dncl/dncl-do-block.test.js +++ b/packages/scratch-gui/test/unit/lib/dncl/dncl-do-block.test.js @@ -87,12 +87,12 @@ describe('Ruby → DNCL: the end of a do block (issue #1665)', () => { }); test('a do inside a string does not open a block', () => { - const ruby = lines('while @a < 1', ' puts("do")', ' say("a do", 1)', 'end'); + const ruby = lines('while @a < 1', ' console.puts("do")', ' console.puts("a do")', 'end'); expect(convert(ruby)).toBe(lines('a < 1 の間繰り返す:', ' 表示する("do")', ' 表示する("a do")')); }); test('a do in a comment at the end of the line does not open a block', () => { - const ruby = lines('while @a < 1', ' move(1) # what to do', ' puts("#") # do', 'end'); + const ruby = lines('while @a < 1', ' move(1) # what to do', ' console.puts("#") # do', 'end'); expect(convert(ruby)).toBe( lines('a < 1 の間繰り返す:', ' move(1) # what to do', ' 表示する("#") # do'), ); diff --git a/packages/scratch-gui/test/unit/lib/dncl/dncl-number-notation.test.js b/packages/scratch-gui/test/unit/lib/dncl/dncl-number-notation.test.js index 11cdbd8726f..62c90fc3a2b 100644 --- a/packages/scratch-gui/test/unit/lib/dncl/dncl-number-notation.test.js +++ b/packages/scratch-gui/test/unit/lib/dncl/dncl-number-notation.test.js @@ -90,19 +90,19 @@ describe('Ruby → DNCL: the same numbers are told on the Ruby line (issue #1745 ['@a = 0x5', '0x5', 6], ['@a = 1_000', '1_000', 6], ['@a = 1e3', '1e3', 6], - ['puts(0b101)', '0b101', 6], + ['console.puts(0b101)', '0b101', 14], ])('%s', (ruby, name, column) => { const { errors } = rubyToDncl(ruby); expect(numberErrors(errors)).toEqual([{ line: 1, column, name }]); }); test('the line is the Ruby line', () => { - const { errors } = rubyToDncl(['@a = 1', 'puts(@a)', '@b = 1e3'].join('\n')); + const { errors } = rubyToDncl(['@a = 1', 'console.puts(@a)', '@b = 1e3'].join('\n')); expect(numberErrors(errors)).toEqual([{ line: 3, column: 6, name: '1e3' }]); }); test('decimal numbers and numbers in strings have no error', () => { - expect(rubyToDncl('@a = 1.5\nputs("0x5")\n@b = 1.to_s # 1e3').errors).toEqual([]); + expect(rubyToDncl('@a = 1.5\nconsole.puts("0x5")\n@b = 1.to_s # 1e3').errors).toEqual([]); }); }); @@ -136,7 +136,7 @@ describe('an integer with leading zeros (issue #1745)', () => { expect(numberErrors(rubyToDncl(ruby).errors)).toEqual([{ line: 1, column, name }]); }); - test.each(['@a = 0', '@a = 0.5', '@a = 10', '@a = 1.05', '@a01 = 1', 'puts("017")'])( + test.each(['@a = 0', '@a = 0.5', '@a = 10', '@a = 1.05', '@a01 = 1', 'console.puts("017")'])( 'Ruby %s has no number error', (ruby) => { expect(rubyToDncl(ruby).errors).toEqual([]); diff --git a/packages/scratch-gui/test/unit/lib/dncl/dncl-post-test-loop.test.js b/packages/scratch-gui/test/unit/lib/dncl/dncl-post-test-loop.test.js index c115b492c85..668d8b4660e 100644 --- a/packages/scratch-gui/test/unit/lib/dncl/dncl-post-test-loop.test.js +++ b/packages/scratch-gui/test/unit/lib/dncl/dncl-post-test-loop.test.js @@ -34,9 +34,17 @@ describe('DNCL: the post-test loop is not supported (issue #1626)', () => { }); test('the error line is the Ruby line even when lines before it are merged', () => { - const ruby = ['@x = ask("")', '@x = answer', 'begin', ' @a = @a + 1', 'end until @a >= 3'].join('\n'); + const ruby = [ + '@i = 1', + 'while @i <= 3', + ' @i += 1', + 'end', + 'begin', + ' @a = @a + 1', + 'end until @a >= 3', + ].join('\n'); const { errors } = rubyToDncl(ruby); - expect(errors.map((e) => e.line)).toEqual([3, 5]); + expect(errors.map((e) => e.line)).toEqual([5, 7]); }); test('nested in a while loop, the loop around it stays Japanese', () => { diff --git a/packages/scratch-gui/test/unit/lib/dncl/dncl-roundtrip.test.js b/packages/scratch-gui/test/unit/lib/dncl/dncl-roundtrip.test.js index bdd966e39c4..5c4c3e6d0d8 100644 --- a/packages/scratch-gui/test/unit/lib/dncl/dncl-roundtrip.test.js +++ b/packages/scratch-gui/test/unit/lib/dncl/dncl-roundtrip.test.js @@ -201,20 +201,20 @@ describe('DNCL round-trip (DNCL → Ruby → DNCL)', () => { return dnclToRuby(dncl).ruby; }; - test('say(rand(1..10), 1) → console.puts(rand(1..10)) (表示する uses puts)', () => { + test('console.puts(rand(1..10)) → console.puts(rand(1..10)) (表示する uses puts)', () => { // 表示する → puts (Issue #640): the say() output is normalized to // console.puts() in the new direction, so round-trip lands on console.puts(). - expect(rubyRoundtrip('say(rand(1..10), 1)')).toBe('console.puts(rand(1..10))'); + expect(rubyRoundtrip('console.puts(rand(1..10))')).toBe('console.puts(rand(1..10))'); }); - test('say(rand(1..10) + 5, 1) → console.puts(rand(1..10) + 5) (single expr, not flattened)', () => { + test('console.puts(rand(1..10) + 5) → console.puts(rand(1..10) + 5) (single expr, not flattened)', () => { // Operands are not all string-literal-or-.to_s, so the `+` chain // stays as a single expression in DNCL. Round-trips to console.puts(...). - expect(rubyRoundtrip('say(rand(1..10) + 5, 1)')).toBe('console.puts(rand(1..10) + 5)'); + expect(rubyRoundtrip('console.puts(rand(1..10) + 5)')).toBe('console.puts(rand(1..10) + 5)'); }); - test('say(@x.to_i, 1) → console.puts(@x.to_i)', () => { - expect(rubyRoundtrip('say(@x.to_i, 1)')).toBe('console.puts(@x.to_i)'); + test('console.puts(@x.to_i) → console.puts(@x.to_i)', () => { + expect(rubyRoundtrip('console.puts(@x.to_i)')).toBe('console.puts(@x.to_i)'); }); }); diff --git a/packages/scratch-gui/test/unit/lib/dncl/dncl-say-block-roundtrip.test.js b/packages/scratch-gui/test/unit/lib/dncl/dncl-say-block-roundtrip.test.js index 5d6dc991f52..cfaa080cd9b 100644 --- a/packages/scratch-gui/test/unit/lib/dncl/dncl-say-block-roundtrip.test.js +++ b/packages/scratch-gui/test/unit/lib/dncl/dncl-say-block-roundtrip.test.js @@ -1,27 +1,23 @@ // === Smalruby: Lock-in tests for the Block ↔ Ruby ↔ DNCL "display" matrix === // -// Issue #650: codify the unidirectional design for `表示する` / `puts` / `say`. +// Issue #650 / #2623: codify the design of `表示する` / `puts` / `say`. // // Block ↔ Ruby ↔ DNCL の変換マトリクス (本テストで検証する設計): // // 方向 出力 // ───────────────────────────────────────────────────────────────── // Block say(args, n) → Ruby say(args, n) (現状通り) -// Block say(args, n) → DNCL 表示する(args) (秒数 n は無視) -// DNCL 表示する(args) → Ruby console.puts(args) (不可逆: say / puts には戻さない) +// Block say(args, n) → DNCL 誤り(日本語タブでは使えないブロック) +// Block ask + answer → DNCL 誤り(日本語タブでは使えないブロック) +// DNCL 表示する(args) → Ruby console.puts(args) // DNCL 表示する(args) → Block smalrubyConsole_print (コンソールの拡張機能) // -// 不可逆性 (重要): -// DNCL `表示する` は、コンソールへの出力(コンソールの拡張機能のブロック。 -// Ruby では `console.puts`)になる (`say` にも `puts` にも戻さない。#1758、 -// docs/dncl/design.md の 5 章)。`say` は Scratch の吹き出し演出 (秒数指定) を -// 含むため、日本語の「表示」とは異なる。Ruby の `puts` / `say`(コンソールの前の -// 日本語のプログラムと、ルビータブのプログラム)は、`表示する` として読む。 -// -// 秒数の扱い: -// DNCL では秒数を表現しない。Block ↔ Ruby は秒数を保持するが、 -// DNCL を経由すると秒数情報は失われる (1 秒のデフォルトに戻る)。 +// 「言う」(Ruby の `say` / `puts` / `print` / `p`)と「聞いて待つ」「答え」は、日本語タブでは +// 使えない(#2623)。`表示する` と `【外部からの入力】` はコンソールだけの意味にして、同じ言葉が +// 2 つの意味を持たないようにする。人間が作ったブロックのプログラムを黙って変えないため、 +// 日本語にせずに誤りにする(ブロックは変えない)。 import { dnclToRuby } from '../../../../src/lib/dncl/dncl-to-ruby'; +import { UNSUPPORTED_COMMAND_ERROR_ID } from '../../../../src/lib/dncl/dncl-validator'; import { rubyToDncl } from '../../../../src/lib/dncl/ruby-to-dncl'; import { loadPrism } from '../../../../src/lib/prism-parser'; @@ -29,81 +25,73 @@ beforeAll(() => loadPrism()); const dToR = (src) => dnclToRuby(src).ruby; const rToD = (src) => rubyToDncl(src).dncl; +const errorsOf = (src) => rubyToDncl(src).errors; -describe('Display matrix: Ruby say(...) → DNCL 表示する (秒数無視)', () => { - test('say(@a, 1) → 表示する(a)', () => { - expect(rToD('say(@a, 1)')).toBe('表示する(a)'); - }); +const SAY_MESSAGE = '「言う」は日本語タブでは使えないブロックです。コンソールの「(…) を表示する」を使ってください。'; +const ASK_MESSAGE = + '「聞いて待つ」と「答え」は日本語タブでは使えないブロックです。コンソールの「入力する」を使ってください。'; - test('say(@a, 2) → 表示する(a) (秒数 2 は無視)', () => { - expect(rToD('say(@a, 2)')).toBe('表示する(a)'); +describe('Display matrix: the say block is an error in the Japanese tab (#2623)', () => { + test.each([ + ['say(@a, 2)', 'say'], + ['say(@a)', 'say'], + ['puts(@a)', 'puts'], + ['print(@a)', 'print'], + ['p(@a)', 'p'], + ])('%s is told as the say block', (ruby, name) => { + expect(errorsOf(ruby)).toEqual([ + { line: 1, column: 1, id: UNSUPPORTED_COMMAND_ERROR_ID, name, message: SAY_MESSAGE }, + ]); }); - test('say(@a, 0.5) → 表示する(a) (小数の秒数も無視)', () => { - expect(rToD('say(@a, 0.5)')).toBe('表示する(a)'); + test('the say block inside a loop is told on its line', () => { + const errors = errorsOf('3.times do\n say("a", 2)\nend'); + expect(errors.map((e) => [e.line, e.name, e.message])).toEqual([[2, 'say', SAY_MESSAGE]]); }); +}); - test('say(@変数 + "バナナ", 2) → 表示する(変数 + "バナナ")', () => { - // The reported bug case: var + string concat with secs=2. - // The Ruby side keeps the `+` chain because operands are not all - // string-literal-or-.to_s, so flattening doesn't apply. - expect(rToD('say(@変数 + "バナナ", 2)')).toBe('表示する(変数 + "バナナ")'); +describe('Input matrix: ask and answer are errors in the Japanese tab (#2623)', () => { + test('ask("") and the answer on the next line', () => { + const errors = errorsOf('ask("")\n@x = answer'); + expect(errors.length).toBeGreaterThan(0); + expect(errors.every((e) => e.message === ASK_MESSAGE)).toBe(true); + expect(errors[0]).toMatchObject({ line: 1, id: UNSUPPORTED_COMMAND_ERROR_ID, name: 'ask' }); }); - test('say(arg.to_s + "x" + arg2.to_s, 3) → 表示する(arg, "x", arg2)', () => { - // All operands are display fragments (.to_s or string literal), - // so flatten + unwrap applies. - expect(rToD('say(@a.to_s + "x" + @b.to_s, 3)')).toBe('表示する(a, "x", b)'); + test('ask with a question', () => { + expect(errorsOf('ask("名前は?")')).toEqual([ + { line: 1, column: 1, id: UNSUPPORTED_COMMAND_ERROR_ID, name: 'ask', message: ASK_MESSAGE }, + ]); }); }); -describe('Display matrix: DNCL 表示する → Ruby console.puts (不可逆)', () => { - test('表示する(a) → console.puts(@a) (NOT say(...))', () => { - const ruby = dToR('表示する(a)'); - expect(ruby).toBe('console.puts(@a)'); - expect(ruby).not.toMatch(/^say\(/); - }); - - test('表示する("hello") → console.puts("hello")', () => { - expect(dToR('表示する("hello")')).toBe('console.puts("hello")'); +describe('Display matrix: the console stays 表示する / 【外部からの入力】', () => { + test('表示する(a) → console.puts(@a)', () => { + expect(dToR('表示する(a)')).toBe('console.puts(@a)'); }); test('表示する(a, "は", b) → console.puts(@a.to_s + "は" + @b.to_s)', () => { expect(dToR('表示する(a, "は", b)')).toBe('console.puts(@a.to_s + "は" + @b.to_s)'); }); -}); - -describe('Display matrix: full round-trip (intentionally lossy)', () => { - // DNCL → Ruby → DNCL: stable (puts round-trips back to 表示する) - test('DNCL 表示する(a) → Ruby → DNCL stable as 表示する(a)', () => { - const dncl1 = '表示する(a)'; - const ruby = dToR(dncl1); - const dncl2 = rToD(ruby); - expect(dncl2).toBe('表示する(a)'); - }); - // Ruby say → DNCL → Ruby: 不可逆! say(2) becomes console.puts (秒数喪失) - test('Ruby say(@a, 2) → DNCL → Ruby — 不可逆: console.puts(@a) (秒数喪失)', () => { - const ruby1 = 'say(@a, 2)'; - const dncl = rToD(ruby1); - expect(dncl).toBe('表示する(a)'); - const ruby2 = dToR(dncl); - // 不可逆: say には戻らず console.puts、秒数 2 も失われる - expect(ruby2).toBe('console.puts(@a)'); - expect(ruby2).not.toBe(ruby1); - }); - - // Ruby puts → DNCL → Ruby: 不可逆! puts becomes console.puts (the console) - test('Ruby puts(@a) → DNCL → Ruby — 不可逆: console.puts(@a)', () => { - const dncl = rToD('puts(@a)'); - expect(dncl).toBe('表示する(a)'); - expect(dToR(dncl)).toBe('console.puts(@a)'); - }); - - // Ruby console.puts → DNCL → Ruby: stable test('Ruby console.puts(@a) → DNCL → Ruby stable as console.puts(@a)', () => { const ruby1 = 'console.puts(@a)'; expect(rToD(ruby1)).toBe('表示する(a)'); expect(dToR(rToD(ruby1))).toBe(ruby1); }); + + test('Ruby console.gets → 【外部からの入力】', () => { + expect(rToD('@x = console.gets')).toBe('x = 【外部からの入力】'); + expect(rToD('@n = console.gets.to_i')).toBe('n = 【整数を入力】'); + }); +}); + +describe('Japanese typed with the Ruby name of the say block (#2623)', () => { + test('say("a") in the Japanese tells the say block', () => { + const { ruby, errors } = dnclToRuby('say("a")'); + expect(ruby).toBeNull(); + expect(errors.map((e) => [e.id, e.name, e.message])).toEqual([ + [UNSUPPORTED_COMMAND_ERROR_ID, 'say', SAY_MESSAGE], + ]); + }); }); diff --git a/packages/scratch-gui/test/unit/lib/dncl/dncl-stage-variable.test.js b/packages/scratch-gui/test/unit/lib/dncl/dncl-stage-variable.test.js index ec67fb7c254..fdf8f8a6599 100644 --- a/packages/scratch-gui/test/unit/lib/dncl/dncl-stage-variable.test.js +++ b/packages/scratch-gui/test/unit/lib/dncl/dncl-stage-variable.test.js @@ -22,7 +22,7 @@ const told = (line, column, name) => ({ describe('Ruby → DNCL: the variables of the stage (issue #1706)', () => { test('a variable of the stage is told where it is written and read', () => { - expect(rubyToDncl(lines('$a = 1', 'say($a)')).errors).toEqual([told(1, 1, '$a'), told(2, 5, '$a')]); + expect(rubyToDncl(lines('$a = 1', 'console.puts($a)')).errors).toEqual([told(1, 1, '$a'), told(2, 14, '$a')]); }); test('a list of the stage is told, not the command it calls', () => { @@ -34,6 +34,9 @@ describe('Ruby → DNCL: the variables of the stage (issue #1706)', () => { }); test('a variable of the sprite is still written in the Japanese', () => { - expect(rubyToDncl(lines('@a = 1', 'say(@a)'))).toEqual({ dncl: lines('a = 1', '表示する(a)'), errors: [] }); + expect(rubyToDncl(lines('@a = 1', 'console.puts(@a)'))).toEqual({ + dncl: lines('a = 1', '表示する(a)'), + errors: [], + }); }); }); diff --git a/packages/scratch-gui/test/unit/lib/dncl/dncl-trailing-comment.test.js b/packages/scratch-gui/test/unit/lib/dncl/dncl-trailing-comment.test.js index 0003d8b1b0b..03438528dbc 100644 --- a/packages/scratch-gui/test/unit/lib/dncl/dncl-trailing-comment.test.js +++ b/packages/scratch-gui/test/unit/lib/dncl/dncl-trailing-comment.test.js @@ -208,7 +208,6 @@ describe('trailing # comment on block lines (Issue #1696)', () => { 'i を 1 から 3 まで 1 ずつ増やしながら繰り返す: # a # b\n 表示する(i) # p\nを繰り返す # inc # e', '@i = 1\nwhile @i <= 3 # a # b\n console.puts(@i) # p\n @i += 1\nend # inc # e', ], - ['input', 'ask("") # q\n@x = answer # a', 'x = 【外部からの入力】 # q # a', '@x = console.gets # q # a'], ])('%s', (name, ruby, dncl, rubyBack) => { expect(toDncl(ruby)).toBe(dncl); expect(toRuby(dncl)).toBe(rubyBack); diff --git a/packages/scratch-gui/test/unit/lib/dncl/dncl-unsupported-command.test.js b/packages/scratch-gui/test/unit/lib/dncl/dncl-unsupported-command.test.js index b9380022026..56afea90457 100644 --- a/packages/scratch-gui/test/unit/lib/dncl/dncl-unsupported-command.test.js +++ b/packages/scratch-gui/test/unit/lib/dncl/dncl-unsupported-command.test.js @@ -190,7 +190,7 @@ describe('Ruby → DNCL: a command the Japanese mode does not have is told on it }); test('code the Japanese mode has has no error', () => { - expect(rubyToDncl(lines('@x = 10', 'say("hello", 1)', 'console.puts(rand(1..6))')).errors).toEqual([]); + expect(rubyToDncl(lines('@x = 10', 'console.puts("hello")', 'console.puts(rand(1..6))')).errors).toEqual([]); }); }); diff --git a/packages/scratch-gui/test/unit/lib/dncl/dncl-validation.test.js b/packages/scratch-gui/test/unit/lib/dncl/dncl-validation.test.js index 7d35a55045b..51fc52a90d1 100644 --- a/packages/scratch-gui/test/unit/lib/dncl/dncl-validation.test.js +++ b/packages/scratch-gui/test/unit/lib/dncl/dncl-validation.test.js @@ -65,14 +65,14 @@ describe('DNCL mode switch validation', () => { }); test('simple variable assignment and say', async () => { - const code = '@x = 10\nsay("hello", 1)\n'; + const code = '@x = 10\nconsole.puts("hello")\n'; const { valid, errors } = await validateForDncl(code); expect(errors).toHaveLength(0); expect(valid).toBe(true); }); test('variable with if and say', async () => { - const code = ['@x = 10', 'if @x > 5', ' say("big", 1)', 'end', ''].join('\n'); + const code = ['@x = 10', 'if @x > 5', ' console.puts("big")', 'end', ''].join('\n'); const { valid } = await validateForDncl(code); expect(valid).toBe(true); }); @@ -80,14 +80,14 @@ describe('DNCL mode switch validation', () => { describe('invalid code (should block switch)', () => { test('when_flag_clicked breaks in DNCL round-trip', async () => { - const code = 'when_flag_clicked do\n say("hello", 1)\nend\n'; + const code = 'when_flag_clicked do\n console.puts("hello")\nend\n'; const { valid, errors } = await validateForDncl(code); expect(valid).toBe(false); expect(errors.length).toBeGreaterThan(0); }); test('when_key_pressed is not supported in DNCL', async () => { - const code = 'when_key_pressed("a") do\n say("hello", 1)\nend\n'; + const code = 'when_key_pressed("a") do\n console.puts("hello")\nend\n'; const { valid, errors } = await validateForDncl(code); expect(valid).toBe(false); expect(errors.length).toBeGreaterThan(0); @@ -130,7 +130,7 @@ describe('DNCL mode switch validation', () => { }); test('when_clicked is not supported in DNCL', async () => { - const code = 'when_clicked do\n say("hello", 1)\nend\n'; + const code = 'when_clicked do\n console.puts("hello")\nend\n'; const { valid, errors } = await validateForDncl(code); expect(valid).toBe(false); expect(errors.length).toBeGreaterThan(0); @@ -139,7 +139,7 @@ describe('DNCL mode switch validation', () => { describe('error message', () => { test('errors use the localized validation message', async () => { - const code = 'when_key_pressed("a") do\n say("hello", 1)\nend\n'; + const code = 'when_key_pressed("a") do\n console.puts("hello")\nend\n'; const { errors } = await validateForDncl(code); for (const err of errors) { expect(err.text).toBe(DNCL_VALIDATION_MESSAGE); diff --git a/packages/scratch-gui/test/unit/lib/dncl/ruby-to-dncl.test.js b/packages/scratch-gui/test/unit/lib/dncl/ruby-to-dncl.test.js index 676ffd3ded1..d8ea013e4d3 100644 --- a/packages/scratch-gui/test/unit/lib/dncl/ruby-to-dncl.test.js +++ b/packages/scratch-gui/test/unit/lib/dncl/ruby-to-dncl.test.js @@ -47,14 +47,6 @@ describe('rubyToDncl', () => { }); describe('display and input', () => { - test('say → 表示する', () => { - expect(convert('say(@a, 1)')).toBe('表示する(a)'); - }); - - test('say with multiple args', () => { - expect(convert('say(@a, @b, @c, 1)')).toBe('表示する(a, b, c)'); - }); - test('console.puts (the console block) → 表示する (#1758)', () => { expect(convert('console.puts(@a)')).toBe('表示する(a)'); expect(convert('console.puts(@a.to_s + "は" + @b.to_s)')).toBe('表示する(a, "は", b)'); @@ -69,28 +61,10 @@ describe('rubyToDncl', () => { expect(rubyToDncl('console.puts(console.gets)').errors).not.toEqual([]); }); - test('ask + answer → 入力', () => { - expect(convert('ask("")\n@a = answer')).toBe('a = 【外部からの入力】'); - }); - - test('ask + answer.to_i → 整数を入力 (Issue #1186)', () => { - expect(convert('ask("")\n@n = answer.to_i')).toBe('n = 【整数を入力】'); - }); - - test('ask_and_wait + answer → 入力 (legacy)', () => { - expect(convert('ask_and_wait("")\n@a = answer')).toBe('a = 【外部からの入力】'); - }); - - test('puts → 表示する', () => { - expect(convert('puts(@a)')).toBe('表示する(a)'); - }); - - test('print → 表示する', () => { - expect(convert('print(@a)')).toBe('表示する(a)'); - }); - - test('p → 表示する', () => { - expect(convert('p(@a)')).toBe('表示する(a)'); + test('say / puts / print / p and ask / answer (the blocks of the stage) are errors (#2623)', () => { + ['say(@a, 1)', 'say(@a)', 'puts(@a)', 'print(@a)', 'p(@a)', 'ask("")\n@a = answer'].forEach((ruby) => { + expect(rubyToDncl(ruby).errors).not.toEqual([]); + }); }); }); @@ -138,21 +112,7 @@ describe('rubyToDncl', () => { describe('nested same-name calls', () => { test('rand(rand(rand(1..10))) fully converts', () => { - expect(convert('puts(rand(rand(rand(1..10))))')).toBe('表示する(乱数(乱数(乱数(1..10))))'); - }); - - test('puts(puts(x)) fully converts', () => { - expect(convert('puts(puts(@x))')).toBe('表示する(表示する(x))'); - }); - - test('p(p(x)) fully converts', () => { - expect(convert('p(p(@x))')).toBe('表示する(表示する(x))'); - }); - - test('say with nested same-name in args', () => { - // say uses splitArgsAtTopLevel; rand(rand(...)) is recognized as a - // single argument and the trailing duration `, 1` is stripped. - expect(convert('say(rand(rand(1..10)), 1)')).toBe('表示する(乱数(乱数(1..10)))'); + expect(convert('console.puts(rand(rand(rand(1..10))))')).toBe('表示する(乱数(乱数(乱数(1..10))))'); }); test('p does not match part of map(', () => { @@ -161,20 +121,6 @@ describe('rubyToDncl', () => { }); }); - describe('display: say with any duration', () => { - test('say with 1 second', () => { - expect(convert('say(@a, 1)')).toBe('表示する(a)'); - }); - - test('say with 2 seconds', () => { - expect(convert('say(@a, 2)')).toBe('表示する(a)'); - }); - - test('say with 0.5 seconds', () => { - expect(convert('say(@a, 0.5)')).toBe('表示する(a)'); - }); - }); - describe('control flow: until', () => { test('until loop converts to not ... の間繰り返す', () => { expect(convert('until @a > 10\n @a = @a + 1\nend')).toBe('not a > 10 の間繰り返す:\n a = a + 1'); @@ -215,13 +161,13 @@ describe('rubyToDncl', () => { describe('control flow: for loop (step syntax)', () => { test('ascending step for loop', () => { - expect(convert('(1..10).step(1) do |i|\n say(@i, 1)\nend')).toBe( + expect(convert('(1..10).step(1) do |i|\n console.puts(@i)\nend')).toBe( 'i を 1 から 10 まで 1 ずつ増やしながら繰り返す:\n 表示する(i)', ); }); test('descending step for loop', () => { - expect(convert('10.step(0, -1) do |i|\n say(@i, 1)\nend')).toBe( + expect(convert('10.step(0, -1) do |i|\n console.puts(@i)\nend')).toBe( 'i を 10 から 0 まで 1 ずつ減らしながら繰り返す:\n 表示する(i)', ); }); @@ -229,17 +175,17 @@ describe('rubyToDncl', () => { describe('control flow: for loop (while pattern)', () => { test('ascending while-based for loop', () => { - const ruby = '@i = 1\nwhile @i <= 10\n say(@i, 1)\n @i += 1\nend'; + const ruby = '@i = 1\nwhile @i <= 10\n console.puts(@i)\n @i += 1\nend'; expect(convert(ruby)).toBe('i を 1 から 10 まで 1 ずつ増やしながら繰り返す:\n 表示する(i)'); }); test('descending while-based for loop', () => { - const ruby = '@i = 10\nwhile @i >= 0\n say(@i, 1)\n @i += -1\nend'; + const ruby = '@i = 10\nwhile @i >= 0\n console.puts(@i)\n @i += -1\nend'; expect(convert(ruby)).toBe('i を 10 から 0 まで 1 ずつ減らしながら繰り返す:\n 表示する(i)'); }); test('ascending while-based for loop with step 2', () => { - const ruby = '@i = 0\nwhile @i <= @n\n say(@i, 1)\n @i += 2\nend'; + const ruby = '@i = 0\nwhile @i <= @n\n console.puts(@i)\n @i += 2\nend'; expect(convert(ruby)).toBe('i を 0 から n まで 2 ずつ増やしながら繰り返す:\n 表示する(i)'); }); @@ -249,7 +195,7 @@ describe('rubyToDncl', () => { 'while @i <= 3', ' @j = 1', ' while @j <= 3', - ' say(@i, 1)', + ' console.puts(@i)', ' @j += 1', ' end', ' @i += 1', @@ -314,7 +260,7 @@ describe('rubyToDncl', () => { }); test('for-loop with CJK loop variable', () => { - const ruby = ['@回数 = 1', 'while @回数 <= 5', ' say(@回数, 1)', ' @回数 += 1', 'end'].join('\n'); + const ruby = ['@回数 = 1', 'while @回数 <= 5', ' console.puts(@回数)', ' @回数 += 1', 'end'].join('\n'); const dncl = ['回数 を 1 から 5 まで 1 ずつ増やしながら繰り返す:', ' 表示する(回数)'].join('\n'); expect(convert(ruby)).toBe(dncl); }); @@ -355,7 +301,7 @@ describe('rubyToDncl', () => { ' @合計 += @i', ' @i += 1', 'end', - 'say(@合計, 1)', + 'console.puts(@合計)', ].join('\n'); const expectedDncl = [ '合計 = 0', diff --git a/packages/scratch-gui/test/unit/lib/make-toolbox-xml-dncl-extensions.test.js b/packages/scratch-gui/test/unit/lib/make-toolbox-xml-dncl-extensions.test.js index c3c610a9e0b..ed80966c0a2 100644 --- a/packages/scratch-gui/test/unit/lib/make-toolbox-xml-dncl-extensions.test.js +++ b/packages/scratch-gui/test/unit/lib/make-toolbox-xml-dncl-extensions.test.js @@ -35,4 +35,19 @@ describe('makeToolboxXML: extensions in the Japanese mode', () => { expect(xml).toContain('id="smalrubyConsole"'); expect(xml).toContain('id="pen"'); }); + + test('hides the looks and sensing categories (say, ask and answer; #2623)', () => { + const xml = toolbox(true); + expect(xml).not.toContain('id="looks"'); + expect(xml).not.toContain('id="sensing"'); + expect(xml).not.toContain('looks_sayforsecs'); + expect(xml).not.toContain('sensing_askandwait'); + expect(xml).toContain('id="operators"'); + }); + + test('shows the looks and sensing categories out of the Japanese mode', () => { + const xml = toolbox(false); + expect(xml).toContain('id="looks"'); + expect(xml).toContain('id="sensing"'); + }); }); diff --git a/packages/scratch-gui/test/unit/lib/ruby-roundtrip/japanese-table.test.js b/packages/scratch-gui/test/unit/lib/ruby-roundtrip/japanese-table.test.js index 31108a81e6e..6e603f06d89 100644 --- a/packages/scratch-gui/test/unit/lib/ruby-roundtrip/japanese-table.test.js +++ b/packages/scratch-gui/test/unit/lib/ruby-roundtrip/japanese-table.test.js @@ -6,8 +6,6 @@ */ import { defineBlockRubyTable } from '../../helpers/block-ruby-table'; -const PUTS = '#"@ruby:method:puts"'; - defineBlockRubyTable('Japanese mode ⇔ Ruby ⇔ blocks', [ { ja: 'x = 1', ruby: '@x = 1', blocks: 'data_setvariableto(VARIABLE = @x, VALUE: "1")' }, { @@ -207,26 +205,6 @@ defineBlockRubyTable('Japanese mode ⇔ Ruby ⇔ blocks', [ blocks: `data_replaceitemoflist(LIST = @_array_Data_, INDEX: operator_add(NUM1: 0, NUM2: 1) #"@ruby:array:index", ITEM: smalrubyConsole_input)`, }, - { - name: 'the input of a program before the console (ask and answer) is read as an input', - ja: 'x = 【外部からの入力】', - jaOnly: 'toJa', - ruby: ` - ask("") - @x = answer - `, - blocks: ` - sensing_askandwait(QUESTION: "") - data_setvariableto(VARIABLE = @x, VALUE: sensing_answer) - `, - }, - { - name: 'the say of a program before the console (and of puts) is read as 表示する', - ja: '表示する(x)', - jaOnly: 'toJa', - ruby: 'puts(@x)', - blocks: `looks_sayforsecs(MESSAGE: @x, SECS: 1) ${PUTS}`, - }, { name: '表示する of a number prints the number', ja: '表示する(3)', From 6b3b3e6d4fb7afc796c598c18412904228e82500 Mon Sep 17 00:00:00 2001 From: "smalruby3-editor-bot[bot]" <297607354+smalruby3-editor-bot[bot]@users.noreply.github.com> Date: Sun, 29 Nov 2026 00:31:06 +0000 Subject: [PATCH 2/4] docs(dncl): drop say and puts from the passed names in the comment The say and ask blocks are no longer passed through in the Japanese tab (#2623). Co-Authored-By: Claude Opus 5.5 --- packages/scratch-gui/src/lib/dncl/dncl-validator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/scratch-gui/src/lib/dncl/dncl-validator.js b/packages/scratch-gui/src/lib/dncl/dncl-validator.js index 4ee83c948c9..2f60252eb80 100644 --- a/packages/scratch-gui/src/lib/dncl/dncl-validator.js +++ b/packages/scratch-gui/src/lib/dncl/dncl-validator.js @@ -302,7 +302,7 @@ const findDeclaredNames = (source) => { * command of a `do` block, and a keyword that jumps in a loop at the head of a * line (`break if i == 5`, issue #1716). The names the Japanese mode has * are the DNCL keywords and built-in functions, the Ruby names the converter - * passes as they are (`puts`, `say`, `rand`, ...) and the functions the + * passes as they are (`rand`, `to_i`, ...) and the functions the * source defines. A variable (a name not called) is not taken, so a * variable may have the name of a command. * @param {string} source - The Japanese (its line numbers and `|` marks blanked out). From 213b83e6b52a6848333d4304e11841b62f320c8b Mon Sep 17 00:00:00 2001 From: "smalruby3-editor-bot[bot]" <297607354+smalruby3-editor-bot[bot]@users.noreply.github.com> Date: Sun, 29 Nov 2026 01:06:42 +0000 Subject: [PATCH 3/4] test(dncl): use console.puts in the japanese tab switch tests say is now a block the Japanese tab cannot write (#2623), so the valid program used console.puts instead, and the when_flag_clicked test keeps checking only when_flag_clicked. Co-Authored-By: Claude Opus 5.5 --- .../scratch-gui/test/integration/dncl-mode-validation.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/scratch-gui/test/integration/dncl-mode-validation.test.js b/packages/scratch-gui/test/integration/dncl-mode-validation.test.js index 63990837646..d8bfadc98b7 100644 --- a/packages/scratch-gui/test/integration/dncl-mode-validation.test.js +++ b/packages/scratch-gui/test/integration/dncl-mode-validation.test.js @@ -147,7 +147,7 @@ describe('the Japanese tab (DNCL) and the check on switching to it', () => { test('valid code allows DNCL switch', async () => { await loadInRubyMode(driver); - await fillInRubyProgram('@x = 10\nsay("hello", 1)\n'); + await fillInRubyProgram('@x = 10\nconsole.puts("hello")\n'); await waitForEditorValue(driver, '@x = 10'); // The Ruby tab has no Japanese button any more: Japanese is the Japanese tab @@ -330,7 +330,7 @@ describe('the Japanese tab (DNCL) and the check on switching to it', () => { test('when_flag_clicked blocks DNCL switch', async () => { await loadInRubyMode(driver); - await fillInRubyProgram('when_flag_clicked do\n say("hello", 1)\nend\n'); + await fillInRubyProgram('when_flag_clicked do\n console.puts("hello")\nend\n'); await waitForEditorValue(driver, 'when_flag_clicked'); await clickJapaneseTab(driver); From 176459c6b6ff0bd68cbaae6be4fbfa6432ca17c6 Mon Sep 17 00:00:00 2001 From: "smalruby3-editor-bot[bot]" <297607354+smalruby3-editor-bot[bot]@users.noreply.github.com> Date: Sun, 29 Nov 2026 01:12:46 +0000 Subject: [PATCH 4/4] docs(dncl): drop the read-only say block from the palette row of the spec The Japanese mode palette no longer has the looks and sensing categories (#2623). Co-Authored-By: Claude Opus 5.5 --- docs/smalruby-dncl-spec.ja.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/smalruby-dncl-spec.ja.md b/docs/smalruby-dncl-spec.ja.md index 379c9f10fb7..c3dbd989527 100644 --- a/docs/smalruby-dncl-spec.ja.md +++ b/docs/smalruby-dncl-spec.ja.md @@ -709,7 +709,7 @@ Monaco エディタで以下の要素がハイライトされます: | 入力 | `【外部からの入力】` → コンソールで答えを受け取る | | スコープ | すべて Scratch のスプライト変数に変換 | | 配列操作 | `要素数(A)`、要素の追加 `A に 値 を追加する`。Scratch のリストブロックも使用可能 | -| ブロック | コードタブでは、日本語で書けるブロック(と「〜と〜秒言う」など読むだけのもの)に絞る | +| ブロック | コードタブでは、日本語で書けるブロックに絞る(見た目・調べるのカテゴリは出さない) | | 誤りのあるとき | 読めない行があるあいだは、ほかのタブやスプライトへ移らず、保存・提出・実行(旗・[実行])・ルビーのバージョンの切りかえもしない(書いた行が消えないように) | ### 内部実装の特徴