The words you are searching are inside this book. To get more targeted content, please make full-text search by clicking here.

งานกลุ่มโปรเเกรม4

Discover the best professional documents and content resources in AnyFlip Document Base.
Search
Published by , 2022-01-05 00:39:33

งานกลุ่มโปรเเกรม4

งานกลุ่มโปรเเกรม4

6. กด Logic เพ่อื เลือก if true then

7. เลือก 0 = 0 เปลีย่ นเป็น dice = 1
8. กด Basic เพ่อื เลือก Show leds

9. กดเลือก Show leds แตะ 1 จดุ ทาไปเรื่อยๆจนถงึ Show leds ท่ี 6 ดงั รูป
10. ควบคมุ

Boolean

การเขยี นโปรแกรม Make Code Programming
เป้าหมาย : เพ่อื ใหเ้ รยี นรูใ้ นส่ือการเรียนรูข้ อง Boolean
ผลโปรแกรม : คาส่งั A และ B ขนึ้ โชวต์ ามท่กี าหนดเอาไว้
ลงิ คเ์ ขา้ ดูงาน : https://makecode.microbit.org/_h2AXsJ57LhYW
ขั้นตอนการเขยี นโปรแกรม
1.เขา้ ไปท่ี Link : https://makecode.microbit.org เพ่อื เขา้ หนา้ โปรแกรม make code คลกิ เลือก New Project จะ
ไดห้ นา้ ตา่ งดงั รูป

2. เลือก on start
3. กด Variable ตงั้ ช่ือเป็น playerAscore ดงั รูป

4. กด Input เลอื ก on button A pressed

5. กดไปท่ี Variable ตงั้ คา่ ขอ้ ความเป็น CoinA
แลว้ กดไปท่ี Math เลือก pick random true or false ดงั รูป

6. กดไปท่ี Logic เลือก if true then else

7. กด 0 = 0 มาใสไ่ วใ้ น true แลว้ เตมิ CoinA ไปใน 0 ตวั หนา้ เตมิ CoinB ไปใน 0 ตวั หลงั แลว้ กดไปท่ี Variable เลือก
change playerAscore by 1 มาเตมิ ในช่อง ดงั รูป

8. กดไปท่ี Basic เลอื ก show string แลว้ กดไปท่ี
Text เลือก join "Hello" "World" -+
แลว้ เปลย่ี นจาก "Hello" เป็น "A" จาก "World" เป็น playerAscore แลว้ กดไปท่ี Basic เลอื ก pause(ms) 100 แต่
เปลีย่ นเป็น 1000 แลว้ เลือก clear screen ทาแบบนซี้ า้ 2รอบ แต่เปล่ยี นจาก "A" เป็น"B" ดงั รูป

9. กดไปท่ี Input เลือก on button B pressed กดไปท่ี Variable เลือก set playerAscore 0 ดงั รูป
10. ควบคมุ

Array Pointer

การเขยี นโปรแกรม Make Code Programming
เป้าหมาย : เพ่อื ใหเ้ รยี นรูใ้ นสือ่ การเรยี นรูข้ อง Array pointer
ผลโปรแกรม : Array_One และ Array_Two แสดงผลตามตวั เลขท่กี าหนด
ลงิ คเ์ ข้าดูงาน : https://makecode.microbit.org/_gUR8RVc1aev2
ขนั้ ตอนการเขียนโปรแกรม
1.เขา้ ไปท่ี Link : https://makecode.microbit.org เพ่อื เขา้ หนา้ โปรแกรม make code คลกิ เลอื ก New Project จะ
ไดห้ นา้ ต่างดงั รูป

2.เลอื ก on start แลว้ ไปกดท่ี Arrays กดเลือก set list to array of 0 1 -+ เปลยี่ นจาก list เป็น Array_One ดงั รูป

3. กด + 11 ครงั้ ใส่เลข 5-55

4. กดไปท่ี Input เลอื ก on button A pressed แลว้ กดไปท่ี Basic เลอื ก show number แลว้ กดไปท่ี Arrays เลือก
list get value at 0 แต่เปลีย่ นจาก list เป็น Array_One และเปลีย่ นจาก 0 เป็น 2 ดงั รูป

5. กดไปท่ี Basic เลอื ก on start แลว้ ไปกดท่ี Arrays กดเลอื ก set list to array of 0 1 -+ เปลย่ี นจาก list เป็น
Array_Two แลว้ ใสค่ าลงไป ดงั รูป

6.กดไปท่ี Input เลอื ก on button B pressed แลว้ กดไปท่ี Basic เลอื ก show number แลว้ กดไปท่ี Arrays เลอื ก list
get value at 0 แต่เปลย่ี นจาก list เป็น Array_Two และเปล่ียนจาก 0 เป็น 5 ดงั รูป

7. ควบคมุ


Click to View FlipBook Version