Install software, programming with robots

Download Report

Transcript Install software, programming with robots

Week 1 : Introduction to Lab.
Policy for Grading
 CS101 grading consists of two parts: theory and practice.
 Theory point
 100 points for midterm exam
 100 points for final exam
 Practice point
 100 points for lecture attendance
 100 points for lab work
 200 points for homework
 Students need to collect at least 320 practice points.
 The final score is determined entirely by the theory point.
 Practice point is just a qualification. You will get F grade if your
practice point is below 320.
Student B
Example
Student A
Student B
Theory(mid/final)
170 (90/80)
197(98/97)
320
319
B
F
Practice
Final grade
Rules

Please be on time.

You should finish the given tasks within each class. TA will check your
program.
 You have to explain your source code when TA checks your code.

If you are absent from your lab., you can participate in another lab. in the
same week.
 However, if you take another lab., you get 50% of lab point as a penalty.
 If you don’t participate in any other lab. as well as your lab., your lab.
score for the week is zero.
 There is no e-mail evaluation for lab. work.
 There is no evaluation for previous lab. work.

Your lab score and lecture attendance will be released on CS101
homepage.
 You can claim your lab score and lecture attendance until following lab and
lecture (by e-mail or in person).
Quiz in lab
 There will be a quiz time in each lab.
 4 points are assigned for quiz
 1 point for participation, 3 points for quiz score
 If you don’t have a quiz, you’ll get 6 points for the lab
attendance.
 Quiz will start at the beginning of the lab session.
Don’t be late!
 You have to concentrate on your lecture!
 Review before lab is recommended.
Programming Assignments
 There will be 4 programming assignments
 The notice will be on the CS101 website ( http://cs101.kaist.ac.kr )
 All programming assignments must be submitted via the homepage
submission program.




No excuse will be accepted about delay even 1 second.
The due date depends on server’s time, not on your computer’s.
You can see the server time by checking details on homework.
Delay penalty : 5% per day
 If you are faced with some problems when you are trying to solve
your homework,
 Do not copy your friends’ homework.
 Even just copying only one method, it’s also regarded as cheating.
 Ask TAs to help you. (Use TA’s office hour! )
Cheating
Copier and source provider
will obviously get F grade
TA’s Office Hour
 TA’s office hour schedule will be shown on the course homepage
soon.
 Please check TA’s office hour schedule
 Notified in the lab information page of the CS101 site.
What is Pair Programming?
 Pair programming is a software development technique in which two
programmers work together at one work station.
 One types in code while the other reviews each line of code as it is
typed in.
 The person typing the code is called the driver.
The person reviewing the code is called the navigator.
 During CS101, lab., pair programming is mandatory.
 Pair programming has a lot of benefits!
 http://en.wikipedia.org/wiki/Pair_programming
Pair Programming
The two programmers
should switch roles every
15 minutes in CS101 class.
• Do not touch the computer
• Review the code
• Think about language issues and
upcoming issues related to the problem
being solved
Navigator
• Work with the computer
• Focus all of his or her
attention, using the
navigator as a safety guide
Driver
CS101 Homepage
 http://cs101.kaist.ac.kr
 You should check CS101 homepage at least once a day not to
miss an important notice.
 HW assignments, change of schedule, claim period, term exam
 Please, join the homepage as a student member.
 You should write your name correctly to User Name field.
 If you are Korean, you should write your name in Korean.
 한국 학생들은 본인의 이름을 띄어쓰기 없이 한글로 쓰세요
 After you login, you can see some additional menus.
 You can see Course Management page.
 You have to register your information.
 Click Register Student Info
– Your Student ID, section, and phone number should be entered
correctly. (If you don’t, you may get some penalties)
 Close Course Management page.
 Logout -> Login again.
Join (1)
①
Join (2)
①
Fill in the blanks
②
Write your real name
e.g. Alan Turing
한국 학생들은 한글로 쓰세요
예) 홍길동
③
Join (3)
①
Join (4)
①
②
Write your email as an user ID
and password
Join (5)
①
Join (6)
①
②
Fill in the blanks and
select your section
correctly
③
How to Install Python
Preparing Programming Environment
 Programming Language
 Python v2.7.2.
 http://www.python.org/
 You have to install Python first before installing Wing IDE
101.
 Software Development Environment
 Wing IDE 101 (Wing Intelligent Development Environment)
 A free basic edition of Wing IDE
 http://www.wingware.com/wingide-101/
How to Install Python
 Python is free to use, even for commercial products, because of its
OSI-approved open source license.
 The program for installation is located in the ‘Download’ board at
Lecture Homepage ( http://cs101.kaist.ac.kr )
 OR, refer to http://www.python.org/download/
 The version is important! You should download Python 2.7.2.
 When the installation asks for the Destination Directory, keep the
default C:\Python27\.
 Do not change anything on the customization page.
How to Install Others
 3 files(excluding Python) for installation is located in the ‘Download’
board at Lecture Homepage ( http://cs101.kaist.ac.kr )
1. Wing IDE 101
 Wing has powerful code intelligence capabilities for Python
programming.
 Execute the downloaded file
– Next, Accept, Next, Next, …..
2. Python Image Library
 PIL adds image processing capabilities to your Python interpreter.
 http://www.pythonware.com/products/pil/
 Just execute the downloaded file
3. CS101-20100902.zip
 This file is for CS101 robot lectures.
 There are 5 files in this compressed file.
Install CS101-20100902.zip
 Extract 5 files to C:\Python27\Lib\site-packages folder
Congratulations!
 You have installed all the necessary software.
 Let’s run our first program!
 Select Start menu -> Program -> Wing IDE 101 4.1 -> Wing IDE 101 4.1
Lab Work
Practices
 Read sections 5~9 doing following tasks in order.
(CourseInfo  Syllabus  Literature  Robot Lecture Notes))
 Using functions (without for-loops)




ZigZag1 (page 4)
Hurdles1 (page 4)
Newspaper1 (page 5)
Harvest1 (page 5)
 Using for-loops & functions
 Hurdles2 (page 5)
 Harvest2 (page 5)
 Harvest3 (page 6)
 You should delete your .py file when your lab class is finished!
 Caution: Save your python files in C:/CS101/ and clear the directory
when you complete the tasks after back-up.
Practices with functions
 Download world files from the download board.
 ZigZag1 (default world)
 Use functions to avoid repetitions and to make your code as clear as
possible.
 Hurdles1 (‘hurdle1.wld’)
 Use functions to make a Robot, named ‘Hubo’, pick up the beeper
following the path indicated below.
Practices with functions
 Newspaper Delivery (‘newspaper.wld’)
 Use top-down design. You can make an outline for a solution,
and then focus on each part of the solution one-by-one.
 Harvest1 (‘harvest1.wld’)
 Use top-down design.
Practices with for-loops
 Using for-loops & functions
 Hurdles2 (‘hurdle1.wld’)
 Do Hurdles1 using for-loops.
 Harvest2 (‘harvest1.wld’)
 Do Harvest1 using for-loops.
 Harvest3 (‘harvest2.wld’)
 Could you pick up all beepers in this map?
Comment
 We use comments for other humans only inside the program.
 To embed programmer-readable annotations.
 To make the source code easier to understand.
 If a line starts with a hash symbol #, then this line is a comment and
will be ignored by the Python interpreter:
# My first program
from cs1robots import *
create_world()
# This line should be ignored!
Any Questions?