みほんに「きをかく」を足し、各みほんに絵文字をつける #45 - #47
Merged
Merged
Conversation
The empty workspace could start you on a square, a star or a spiral, and none of them used a box, an if, or a block of your own — so the one feature that needs seeing to be believed had no way in but building it yourself. 🌳 is that way in: a block that calls itself, stopped by an if, five levels and 31 branches. It is also the argument for the shape #14 took. The box is scaled on the way into each call and divided back out on the way out, so a single global box is enough — the test pins that by checking the last command is forward(-70), the outermost call retracing the trunk it drew. A first release without parameters is not a compromise if this is what fits in it. Every sample now wears the picture it draws — 🟦 ⭐️ 🌀 🌳. The emoji is artwork rather than text: it is the same in every language, so it goes in as a verbatim icon and the string catalog never sees it. Fixes #45
Four buttons that all began with 「サンプル:」 were four labels a child had to read past to reach the word that differs. The word moves to a caption above the list, where it is said once, and the names shorten to しかくをぬる / ほしをかく / うずまきをかく / きをかく — each now telling its own drawing apart from the first character. The old keys retire rather than linger: they had no call site left, and a string catalog full of stale entries is a worse record than none.
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#45 の設計コメントで決めた 3 点(起動画面には出さない / 名前は「き」/ いろとふとさを含む)+ 絵文字つきラベルで実装しました。
入れたもの
SampleBlocks.fractalTree()— 再帰する木。ペン(みどり・2)→ はこ 🌟 = 70 → よぶ き → つくる き(もし 🌟 > 6 なら …)SampleBlocksTestsに決定的な期待値Sample: Tree→ サンプル: きをかく)実測値
forward(-70)= いちばん外側の呼び出しが自分の幹を戻りきる。はこ 1 個で足りることがこれで固定されます(関数ブロック(マイブロック) #14 がパラメータなしで妥当だった根拠)絵文字の入れかた
絵文字はテキストではなく絵として扱っています。どの言語でも同じものなので
Text(verbatim:)のアイコンとして渡し、文字列カタログには入れていません(Label { Text(title) } icon: { Text(verbatim: emoji) })。ラベル自体は既存の 3 つも含めてSampleButtonに集約しました。確認
swift test119 tests green、両ビルド green、swift format lint --strictcleanひとつ相談
絵文字が付いたことで 「サンプル:」の接頭辞が冗長に見えます(🌳 サンプル: きをかく)。絵文字がその役目を果たしているので、
と短くする手もあります。既存 3 つの文字列を変えることになるので、この PR では触っていません。好みを聞かせてください。
Fixes #45