Difference between revisions of "IB Computer Science 1"

From WLCS
 
Line 1: Line 1:
== Thursday - Friday (1/2/14 - 1/3/14) ==
+
== [[IBCS1 - Archives]] ==
'''Agenda:'''
 
* Be sure to share the Acey Deucey Flowchart with Mr. Bui over Google Drive
 
* Code Acey Deucey (by the end of the quarter)
 
** Copy and paste your flow chart steps into a new python file
 
** Change all your steps into comments
 
** Begin coding the game
 
** Be sure to reference the War Card Game for hints on how to create and deal cards
 
** Each student will be allowed a total of 3 free debugging questions
 
** Unused questions will get extra credit
 
** Outside of class (lunch, GP, after school), you may ask any questions without penalty
 
** Asking questions beyond the 3 extra credit options will not further penalize you
 
 
 
'''Deadlines:'''
 
** Period 7 - Thursday (1/16/14)
 
** Period 6 - Friday (1/17/14)
 
 
 
'''Testing:'''
 
* [[Media:TestCards.txt]]
 
 
 
== Monday - Wednesday (12/23/13 - 1/1/14) ==
 
* Winter Break
 
 
 
'''Homework:'''
 
* Complete the Acey Deucey Flowchart over the non-denominational winter holiday
 
* Share the flowchart with Mr. Bui over Google Drive
 
** You can upload as a pdf and share it
 
 
 
== Thursday - Friday (12/19/13) ==
 
'''Agenda:'''
 
* War Code Quiz
 
* Acey Deucey Rules checklist
 
* Acey Deucey Flowchart Assignment
 
*# Read all the rules of the game: [http://en.wikipedia.org/wiki/Acey_Deucey_(card_game) Acey Deucey Rules]
 
*# You do not need to learn or use the region-specific rules.
 
*# Create a flowchart that models the Acey Deucey card game and its rules (you can use whatever program(s) you like)
 
*# You need to be sure to include all the rules in your flow chart
 
*# You need to use the standard flowchart symbols: [[Media:Flowcharts.ppt]]
 
 
 
'''Homework:'''
 
* Complete the Acey Deucey Flowchart over the non-denominational winter holiday
 
* Share the flowchart with Mr. Bui over Google Drive
 
** You can upload as a pdf and share it
 
 
 
== Monday - Wednesday (12/16/13 - 12/18/13) ==
 
'''Agenda:'''
 
* War Card Simulation
 
*# Finish War Code
 
*# Receive a copy of the War code
 
*# Type up the War code on your computer and comment the code to explain what all the major lines do
 
*# Make sure your War Card program works
 
* Bring a deck of cards to next class
 
* Acey Deucey Flowchart Assignment
 
*# Read all the rules of the game: [http://en.wikipedia.org/wiki/Acey_Deucey_(card_game) Acey Deucey Rules]
 
*# You do not need to learn or use the region-specific rules.
 
*# Create a flowchart that models the Acey Deucey card game and its rules (you can use whatever program(s) you like)
 
*# You need to be sure to include all the rules in your flow chart
 
*# You need to use the standard flowchart symbols: [[Media:Flowcharts.ppt]]
 
 
 
== Wednesday - Friday (12/11/13 - 12/13/13) ==
 
'''Agenda:'''
 
* Introduction to Flow Charts
 
** [[Media:Flowcharts.ppt]]
 
** Draw the flowchart for the list search algorithm (finding a number in a list of numbers)
 
** Draw the flowchart for the list minimum algorithm
 
* War Card "Game" Simulator Walk-through
 
*# Read the [http://en.wikipedia.org/wiki/War_(card_game) War Rules]
 
*# On a piece of paper or using a computer drawing tool (e.g. Google Draw, MS Word), create a flow chart for the rules and steps of War. Be sure to include the following steps:
 
*#* Shuffle deck
 
*#* Deal deck halves to 2 players
 
*#* Each player reveals top card
 
*#* Player with higher card puts both cards at the bottom of his/her deck
 
*#* If both players' cards match, then there is "war"
 
*#*# Both players put 3 cards face down, and reveal 4th card face up. Player with higher card takes all 10 cards
 
*# We will code the War card game as a class using our flow chart
 
* Receive a copy of the War code
 
* Type up the War code on your computer and comment the code to explain what all the major lines do
 
 
 
== Monday - Tuesday (12/9/13 - 12/10/13) ==
 
* Snow Days
 
 
 
== Thursday - Friday (12/5/13 - 12/6/13) ==
 
'''Warmup:'''
 
* Text-based card game introduction warmup
 
*# Create a text file that has all the names for a deck of cards (Examples: 5 of Diamonds, Jack of Clubs)
 
*# Write a program that loads the text file's data into a list of strings
 
*#* Look through [http://docs.python.org/3.3/tutorial/inputoutput.html#reading-and-writing-files Python-reading and writing files] and find the the '''f.readlines()''' function
 
*# Store all the strings loaded into a list of strings named deck
 
*# Create 2 empty lists named p1Hand and p2Hand
 
*# Deal 5 cards from the deck to p1Hand
 
*#* Look through [http://docs.python.org/3.3/tutorial/datastructures.html#more-on-lists Python-Lists] and find the '''list.pop()''' function.  Read how the functions works to remove elements from a list.  You can then use the '''list.append()''' function to add those elements to another list
 
*# Deal 5 cards from the deck to p2Hand
 
*# Print out both hands
 
'''Agenda:'''
 
* Introduction to Flow Charts
 
** [[Media:Flowcharts.ppt]]
 
** Draw the flowchart for the list search algorithm (finding a number in a list of numbers)
 
** Draw the flowchart for the list minimum algorithm
 
* War Card "Game" Simulator Walk-through
 
*# Read the [http://en.wikipedia.org/wiki/War_(card_game) War Rules]
 
*# On a piece of paper or using a computer drawing tool (e.g. Google Draw, MS Word), create a flow chart for the rules and steps of War. Be sure to include the following steps:
 
*#* Shuffle deck
 
*#* Deal deck halves to 2 players
 
*#* Each player reveals top card
 
*#* Player with higher card puts both cards at the bottom of his/her deck
 
*#* If both players' cards match, then there is "war"
 
*#*# Both players put 3 cards face down, and reveal 4th card face up. Player with higher card takes all 10 cards
 
*# We will code the War card game as a class using our flow chart
 
 
 
== Monday - Wednesday (12/2/13 - 12/4/13) ==
 
'''Agenda:'''
 
* Demo [[Advanced Python List Exercises]]
 
* List & String Practice
 
*# Assume you have a list of strings of peoples' full names in random order.  Print out an alphabetized list of only the last names.
 
*# Assume you have a single string containing the entire U.S. Constitution.  Calculate and print out the frequency of the word "the"
 
*#* Download the following file: [[Media:Constitution.txt]]
 
*#* Hint: There is a useful string function converts a string to a list of words.
 
*# Assume you have a single data file with 1000 random numbers from 0 to 100.  Print out the frequency of each of the numbers.
 
*#* Example code to help read in a file:
 
<syntaxhighlight lang="Python">
 
# open a text file
 
file = open("Constitution.txt", "r")
 
 
 
# read all lines in the file and save in the constitution string variable
 
constitutionStr = file.read()
 
 
 
# close the file
 
file.close()
 
 
 
print(constitutionStr)
 
</syntaxhighlight>
 
== Archives ==
 
* [[IBCS1 - 1314 - November]]
 
* [[IBCS1 - 1314 - October]]
 
* [[IBCS1 - 1314 - September]]
 

Latest revision as of 08:28, 13 September 2023