S K
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    ###### tags: `minecraft` <style> * {font-family: 'Hiragino Kaku Gothic ProN','ヒラギノ角ゴ ProN W3','Verdana','Arial',sans-serif;} .markdown-body {font-family: 'Hiragino Kaku Gothic ProN','ヒラギノ角ゴ ProN W3','Verdana','Arial',sans-serif;} h2 {padding-top: 50px;} img {margin: 20px auto;} .alert-success {margin-top: 50px;} .alert h2 {padding-top: 0px;} .part {letter-spacing: .1rem;} .markdown-body h3 {margin-top: 12px;margin-bottom: 12px;} .markdown-body p {font-size: 1.25em;margin-top: 12px; margin-bottom: 16px;} .markdown-body li {font-size: 1.25em;} .markdown-body pre {font-size: 20px;} .focus {color: red;font-weight: bold;} .link-box {display: flex;justify-content: space-between; margin-top: 50px;margin-bottom: 50px;} a.link {display: block; width: 50%; padding: 10px 15px; text-align: center; color: #fff; font-weight: bold; font-size: 20px; letter-spacing: .1em; text-decoration: none;} a.link:hover {opacity: 0.85;} a.prev {background: linear-gradient(to bottom, #1A7BBD 0%, #1A7BBD 50%, #125684 51%, #125684 100%); border-radius: 10px 0 0 10px;} a.next {background: linear-gradient(to bottom, #D76820 0%, #D76820 50%, #964816 51%, #964816 100%); border-radius: 0 10px 10px 0;} </style> > [name=shinya kunisada] # 【第1回】 タートルの使い方 :::success ## ◆ 今回の目標 - 今までと違う新しいタートルを使えるようになろう - 新しいエディタでプログラムを書いたり、動かしたりしよう ::: ## ◆ これから使うタートル 体験授業では、みどり色のタートルを使ったけど、これからは灰色の<span class="focus">タートル(ロボット)</span>を使っていくよ! ![](https://i.imgur.com/Fn9LczY.png) ## ◆ なんで灰色のタートルを使うの? 灰色のタートルは、みどりのタートルとちがって、剣やオノ、作業台など、いろいろなアイテムをそうびして使うことができるからとっても便利なんだよ! ![](https://i.imgur.com/iyLO44v.png) さらに、灰色のタートルはこわして運ぶこともできるから移動もしやすいね! ![](https://i.imgur.com/EtGb1YW.png) ## ◆ 課題1 タートルを作れるようになろう それではさっそくだけど、このタートルを作ってみよう! 授業用のワールドにはあらかじめタートルの材料が用意してあるよ! 下のリストを見ながら、必要な素材を取ってきてね! - <span class="focus">焼き石(丸石を焼くとできる) × 7個</span> - <span class="focus">レッドストーン × 1個</span> - <span class="focus">うすいガラス × 1個</span> - <span class="focus">鉄インゴット(鉄を焼くとできる) × 7個</span> - <span class="focus">チェスト × 1個</span> 素材が集められたら、作業台で下のレシピを参考に<span class="focus">タートル</span>を作ってみよう! 2段階でクラフトするよ! 左のレシピでできた<span class="focus">コンピュータ</span>を右のレシピの中央に置いて、もう1段階クラフトしよう! ![](https://i.imgur.com/jz1WyXI.png) タートルが作れたら地面に置いてみよう! ![](https://i.imgur.com/Gkr1Pws.png) <span class="focus">これがタートルの顔(前側)だよ!</span> ## ◆ タートルに話しかける この画面が、タートルと話す画面だよ! 文字を打つことで話すことができるんだ! 画面の左端に <span class="focus">></span>の記号があるのが目印だね! この画面のことを<span class="focus">対話(たいわ)画面</span>というよ! ![](https://i.imgur.com/TTYp0rr.png) 対話画面では<span class="focus">プログラムは書けない</span>んだったね! ## ◆ タートルの名前 タートルには名前をつけることができるんだけど、<span class="focus">タートルを作ったら必ず名前をつける</span>ようにしよう! タートルに名前をつけないと、<span class="focus">タートルをこわしたときに、作ったプログラムが全て消えてしまう</span>よ! 気をつけてね!!!Σ(・□・;) ![](https://i.imgur.com/FnTJKQP.png) ## ◆ 課題2 名前をつけれるようになろう それではタートルに名前をつけてあげよう! 置いてあるタートルを<span class="focus">右クリック</span>すると、<span class="focus">対話(対話)画面</span>が出てくるよ! その対話画面に、次のように入力するんだ! ``` > label set <タートルの名前> ``` <span class="focus"><タートルの名前></span>の部分は、自分の好きな名前を入力しよう! 例えば先生だったら... ``` > label set turtle ``` 入力したら<span class="focus">Enterキー</span>を押そう! <span class="focus">escキー</span>を押すと、対話画面を閉じることができるよ! タートルを見てみると、タートルの上に名前が表示されているのがわかるかな? ![](https://i.imgur.com/OLfpCdP.png) これで準備オッケーだよ! ## ◆ 課題3 カンタンなプログラムを実行しよう 名前もつけることができたので、次はプログラムを動かしてみよう! タートルにはすでにプログラムがいくつか入っているので、さっそく実行してみよう! もう一度タートルを右クリックして、対話(たいわ)画面を開こう! プログラムを実行するときは、対話画面でプログラムの名前を入力すると実行できるよ! 今回は<span class="focus">dance</span>という名前のプログラムを実行してみよう! さっそく対話画面で、次のように入力するよ! ``` > dance ``` そのままプログラムの名前を入力するだけだね! 入力したら<span class="focus">Enterキー</span>を押そう! <span class="focus">escキー</span>を押すと、対話画面を閉じることができるよ! タートルを見てみると、どのようになっているかな? ![](https://i.imgur.com/yOz0nbu.png) Enterキーを押すと出てくるこのメッセージは、 > タートルを止めるときは、何かキーを押してね! と書いてあるから、対話画面を開いて好きなキーを押してみよう。 タートルの動きは止まったかな? ## ◆ タートルを使う時の注意点 実は、灰色のタートルは<span class="focus">燃料</span>がないと動かないんだ。 はじめにたくさんの燃料をタートルに入れておこう! それでは次からプログラムで燃料を入れていくよ! ![](https://i.imgur.com/vWU5ElL.png) ## ◆ 新しいエディタ 燃料を入れるプログラムを書くために、<span class="focus">ちょっと新しくなったエディタの使い方</span>を覚えよう! ## ◆ 新しいエディタを使おう プログラムは対話画面とはちがった画面で書かないといけないんだ。 対話画面ではプログラムはかけないんだよ! プログラムを書くための画面のことを<span class="focus">エディタ画面</span>というよ! <span class="focus">エディタ画面</span> ![](https://i.imgur.com/lIK7W58.png) ## ◆ プログラムの書き方 プログラムを書くにはまず、<span class="focus">エディタ画面</span>に移動しよう。 エディタ画面に移動するには<span class="focus">editコマンド</span>を使うよ! ``` > edit <プログラムの名前> ``` とすると、<プログラムの名前>で動かせるプログラムができるよ! 今回は<span class="focus">nenryou</span>というプログラムの名前にしてみよう! 対話画面で ``` > edit nenryou ``` と入力するよ!入力したらEnterキーを押そう!エディタ画面に移動したかな? ## ◆ テキストエディタの使い方 エディタ画面に移動したら、プログラムを書いていくよ! プログラムは、みどり色のタートルと同じように書くことができるんだ。 ただし、カーソルはマウスじゃなくて矢印キーでしか動かせないよ! ## ◆ テキストエディタを使う時の注意 せっかく書いたプログラムが消えたりしないように、次のことに注意しよう! 1. プログラムを書き換えたら<span class="focus">必ず保存しよう!</span> 2. 新しいプログラムを書くときは<span class="focus">新しい名前のプログラムを作ってから書こう!</span> ## ◆ 課題4 燃料を入れよう それでは<span class="focus">燃料</span>を入れるプログラムを書いてみよう! まずはじめに、タートルに燃料となる<span class="focus">石炭</span>を持たせておこう! ![](https://i.imgur.com/1jh0G7g.png) 燃料を入れるプログラムは次のように動かしたい。 <span class="focus">1. 燃料が入っているスロットを選ぶ</span> <span class="focus">2. どのくらい燃料を入れるか決めて、燃料を入れる</span> 1. <span class="focus">turtle.select(スロット番号)命令</span>でスロットを選ぶことができるよ! スロット番号は<span class="focus">1〜16</span>のどれかじゃないとエラーになるから注意してね! 2. <span class="focus">turtle.refuel(個数)命令</span>で、指定した個数だけ燃料を補給することができるよ! ## ◆ 実際にプログラムを書いてみよう! それでは一緒にやっていくよ! まずはじめにプログラムを用意しよう! <span class="focus">editコマンド</span>でプログラムを作れるんだったね! 今回はプログラムの名前を<span class="focus">nenryou</span>にしてみよう! ``` > edit nenryou ``` 対話画面からエディタ画面に変わったかな? エディタ画面で、さっきのプログラムを書いてみよう! スロットを選ぶ命令は、 <span class="focus">turtle.select(スロット番号)</span>だったね! 石炭は5番目のスロットに入れたから... ```lua= turtle.select(5) ``` これで、5番目のスロットが選ばれるね! それじゃあどのくらい燃料にするか決めて、燃料を補給しよう! 燃料を補給する命令は<span class="focus">turtle.refuel(個数)</span>だから... ```lua= turtle.select(5) turtle.refuel(64) ``` これで、<span class="focus">5</span>番目のスロットの石炭が<span class="focus">64</span>個、燃料に補給されるはずだ! プログラムがかけたら<span class="focus">必ず保存しよう</span>ね! プログラムを保存するには、 まず、<span class="focus">ctrlキー</span>を押して、<span class="focus">Save</span>と<span class="focus">Exit</span>から、<span class="focus">Save</span>を選んで<span class="focus">Enterキー</span>を押そう! きちんと保存できたら、もう一度<span class="focus">ctrlキー</span>を押して、今度は<span class="focus">Save</span>と<span class="focus">Exit</span>から、<span class="focus">Exit</span>を選んで<span class="focus">Enterキー</span>を押そう! 対話画面に戻ってきたかな? それでは、さっき書いたプログラムを実行するよ! <span class="focus">プログラムを実行</span>するには、<span class="focus">対話画面でプログラム名を入力</span>したらいいんだよね! 今回のプログラム名は...<span class="focus">nenryou</span>だったね! さっそく入力してみよう! 対話画面でプログラム名を入力したら<span class="focus">Enterキー</span>を押して実行してみよう! 燃料は補給されたかな? <!-- 【<span class="focus">動画</span>で解説$\downarrow$】 {%youtube 5Z7AM79nOn8 %} --> ## ◆ 課題5 カンタンなプログラムを書こう それでは、課題4を参考にしてカンタンなプログラムを作ってみよう! <span class="focus">目の前のブロックを掘って、前へ進むプログラムを作ってみよう!</span> 目の前のブロックを掘るためには<span class="focus">マイニングタートル</span>が必要だよ! マイニングタートルは、<span class="focus">タートル</span>と<span class="focus">ツルハシ</span>をクラフトして作るんだ! ![](https://i.imgur.com/Bgfz8SB.png) ![](https://i.imgur.com/FaD4ZW9.png) 目の前に1マス進む命令は<span class="focus">turtle.forward()</span>だよ! 目の前のブロックを掘る命令は<span class="focus">turtle.dig()</span>だよ! プログラムがかけたら動かしてみよう! ## ◆ 課題6 カンタンなプログラムを書こう2 もう一つ、課題4を参考にしてカンタンなプログラムを作ってみよう! <span class="focus">目の前にブロックを置いて、そのブロックの上に移動しよう!</span> 目の前にブロックを置く命令は<span class="focus">turtle.place()</span>だよ! 目の前に置くブロックをタートルに持たせるのを忘れないでね! <!-- ## ◆ 課題7 実際に作ってみよう ここまでできた人は、自分のワールドを作って、素材を集めてからタートルをクラフトしてみよう! 集める素材は下のリストを見ながら取ってきてね! - <span class="focus">焼き石(丸石を焼くとできる) × 7個</span> - <span class="focus">レッドストーン × 1個</span> - <span class="focus">うすいガラス × 1個</span> - <span class="focus">鉄インゴット(鉄を焼くとできる) × 7個</span> - <span class="focus">チェスト × 1個</span> 素材が集められたら、作業台で下のレシピを参考に<span class="focus">タートル</span>を作ってみよう! 2段階でクラフトするよ! 左のレシピでできた<span class="focus">コンピュータ</span>を右のレシピの中央に置いて、もう1段階クラフトしよう! ![](https://i.imgur.com/jz1WyXI.png) --> :::warning ◆ ここまでのプログラム一覧 turtle.forward():前に進む turtle.back():後ろにさがる turtle.up():上に上がる turtle.down():下に下がる turtle.turnLeft():左を向く turtle.turnRight():右を向く turtle.dig():目の前のブロックを掘る turtle.place():目の前にブロックを置く ::: :::info ★ 次の課題へ進もう! :::

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully