What computing is · วิทยาการคอมพิวเตอร์คืออะไร
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · หน้านี้ต้องใช้เบราว์เซอร์ล่าสุด (รองรับ SharedArrayBuffer) กรุณาอัปเดต Chrome, Edge, Firefox หรือ Safari เป็นเวอร์ชันล่าสุด
English
Welcome to AP CSP
- This is AP Computer Science Principles — the big ideas of computing.
- You already learned Python in the basics course. Here we use it for AP ideas.
- Some lessons are reading only. Others let you run code. Read each step, then press Continue.
ไทย
ยินดีต้อนรับสู่ AP CSP
- นี่คือ AP Computer Science Principles — แนวคิดหลักด้านวิทยาการคำนวณ
- คุณเคยเรียน Python ในคอร์สพื้นฐานไปแล้ว ที่นี่เราจะใช้มันเพื่อศึกษาแนวคิดของ AP
- บางบทเรียนเป็นการอ่านเท่านั้น บางบทเรียนให้คุณรันโค้ดได้ อ่านแต่ละขั้นตอนแล้วกด Continue
English
Every program has a purpose
- A program is a set of instructions a computer follows.
- Every program is made for a reason — to solve a problem or help people.
- Example purposes: send a message, play a song, find the shortest road.
ไทย
โปรแกรมทุกตัวมีวัตถุประสงค์
- โปรแกรม คือชุดคำสั่งที่คอมพิวเตอร์ทำตาม
- โปรแกรมทุกตัวถูกสร้างมาเพื่อ เหตุผล — เพื่อแก้ปัญหาหรือช่วยเหลือผู้คน
- ตัวอย่างวัตถุประสงค์: ส่งข้อความ เล่นเพลง หาเส้นทางที่สั้นที่สุด
English
Input → process → output
- Most programs work in three steps.
- Input: data goes in (a number you type, a tap, a file).
- Process: the program does work on that data.
- Output: a result comes out (text on the screen, a sound, a saved file).
ไทย
Input → Process → Output
- โปรแกรมส่วนใหญ่ทำงานผ่านสามขั้นตอน
- Input: ข้อมูลเข้า (ตัวเลขที่คุณพิมพ์, การแตะ, ไฟล์)
- Process: โปรแกรมดำเนินการกับข้อมูลเหล่านั้น
- Output: ผลลัพธ์ออกมา (ข้อความบนหน้าจอ, เสียง, ไฟล์ที่บันทึก)
INPUT PROCESS OUTPUT
"5" -> add 5 and 3 -> "8"
English
A tiny example
- This program takes an input (a name), does a small process, and shows an output.
- You do not need to write it now — just read it and find the three steps.
ไทย
ตัวอย่างเล็กๆ น้อยๆ
- โปรแกรมนี้รับ input (ชื่อ), ทำ process เล็กน้อย และแสดง output
- คุณไม่จำเป็นต้องเขียนมันตอนนี้ — เพียงแค่อ่านและหาสามขั้นตอน
name = input("Your name: ") # input
greeting = "Hello, " + name # process
print(greeting) # output
English
Design is a cycle
- Good programs are not written perfectly the first time.
- We use an iterative cycle: do it again and again, a little better each time.
- Plan → write → test → improve, then repeat.
ไทย
การออกแบบเป็นวงจร
- โปรแกรมที่ดีไม่ได้ถูกเขียนออกมาอย่างสมบูรณ์แบบตั้งแต่ครั้งแรก
- เราใช้ รอบการทำงานแบบวนซ้ำ: ทำซ้ำอีกครั้งและอีกครั้ง ดีขึ้นเล็กน้อยในแต่ละครั้ง
- วางแผน → เขียน → ทดสอบ → ปรับปรุง แล้วทำซ้ำ
plan ──> write ──> test ──> improve
^ │
└──────────────────────────────┘
English
Errors are normal
- An error (a bug) is a mistake that makes the program do the wrong thing.
- In the basics course you learned to debug: read the message, find the line, fix it.
- Finding and fixing bugs is a normal part of every step in the cycle.
ไทย
ความผิดพลาดเป็นเรื่องปกติ
- ความผิดพลาด (บัก) คือข้อผิดพลาดที่ทำให้โปรแกรมทำงานผิดไปจากที่ควรจะเป็น
- ในหลักสูตรพื้นฐาน คุณได้เรียนรู้เรื่อง การแก้ไขข้อผิดพลาด: อ่านข้อความ, หาบรรทัด, แก้ไขให้ถูกต้อง
- การหาและแก้ไขบักเป็นส่วนหนึ่งของทุกขั้นตอนในวงจรอย่างปกติ
English
Computing is collaborative
- Most real programs are built by a team, not one person.
- People share ideas, split the work, and check each other's code.
- Different people bring different views, which makes the program better.
ไทย
การคำนวณเป็นงานทีม
- โปรแกรมส่วนใหญ่ถูกสร้างโดย ทีม ไม่ใช่บุคคลเดียว
- คนในทีมแลกเปลี่ยนไอเดีย, แบ่งงาน, และตรวจสอบโค้ดของกันและกัน
- แต่ละคนมีมุมมองที่แตกต่างกัน ซึ่งทำให้โปรแกรมดีขึ้น
English
Common mistakes
- Computing is problem-solving with data, not just typing code.
- An algorithm is a clear, finite sequence of steps.
ไทย
ข้อผิดพลาดที่พบบ่อย
- การคำนวณคือการแก้ปัญหาด้วยข้อมูล ไม่ใช่แค่การพิมพ์โค้ดเท่านั้น
- อัลกอริทึมคือลำดับขั้นตอนที่ชัดเจนและมีจำนวนจำกัด
English
What is next
- This course follows the 5 Big Ideas of AP CSP: Creative Development, Data, Algorithms & Programming, Computer Systems & Networks, and the Impact of Computing.
- Next lesson we look at bits and binary — how computers store data with 0s and 1s.
- First, try the small task below — take an input, process it, and print the output, just like the example above.
ไทย
สิ่งถัดไป
- หลักสูตรนี้สอดคล้องกับ 5 แนวคิดหลัก ของ AP CSP: การพัฒนาเชิงสร้างสรรค์, ข้อมูล, อัลกอริทึมและการเขียนโปรแกรม, ระบบคอมพิวเตอร์และเครือข่าย, และ ผลกระทบของการคำนวณ
- บทเรียนถัดไปเราจะดูเรื่อง bites and binary — คอมพิวเตอร์จัดเก็บข้อมูลโดยใช้ 0s และ 1s
- ก่อนอื่น ลองทำภารกิจเล็กๆ ด้านล่าง — รับอินพุต, ประมวลผล, และแสดงผลเอาต์พุต เหมือนตัวอย่างด้านบน
Explore · สำรวจ
Input → process → output · อินพุต → ประมวลผล → เอาต์พุต
Every computation takes input, processes it, and gives output. · ทุกการคำนวณต้องรับ อินพุต, ประมวลผล และให้ เอาต์พุต
Try the three steps yourself. The input is already given as the variable name. Process it into a greeting, then output it: print Hello, followed by the name. · ลองทำสามขั้นตอนนี้เอง อินพุต ถูกกำหนด sẵnเป็นตัวแปร name ประมวลผล เป็นคำทักทาย แล้ว เอาต์พุต: พิมพ์ Hello, ตามด้วยชื่อ
Click Run to see the output here. · คลิก Run เพื่อดูผลลัพธ์ที่นี่