Rochambeau

In this assignment students work either individually or in pairs to write a program that plays the rock, paper, scissors with the user. Students must prompt the user for a choice of move, choose a move for the computer to make, and then display the results of the game. Students can choose whether their program plays honestly or cheats. This assignment requires students to work with basic console i/o and variables. It is particularly useful as a first assignment.

vPool Project

In this project students work either individually or in pairs to write an open-ended game loosely based on pool. Using VPython, students must write a pool-like game with a cue ball (or other object) that the player controls directly, other balls, walls, and some kind of hole in which the balls can fall (or other goal). These different objects must be able to interact simultaneously with some semblance of physics, either realistic or wacky. In addition to requiring students to work with graphics, this project allows students to work on creating their own programatic design. It is particularly useful for students who need additional practice designing and then implementing large programs.

The Evolution of Picobot

In this project students work either individually or in pairs to write a program that generates random Picobots, robots that move around a world according to a set of rules, and creates subsequent generations by "mating" the "fittest" Picobots. Students must write at least two classes, one to represent a Picobot program and one to represent a Picobot world. They use these classes to generate a random generation of Picobots to begin and assess the fitness of each Picobot, mating them and outputting the results for each generation. In addition to reviewing classes, strings, and random number generation, this project requires students to design their own classes. It is particularly useful for students who need additional practice designing multiple, interacting classes.

Text ID

In this project students work either individually or in pairs to write a text identification class that uses the Naive Bayes Classifier to determine what author is likely to have written a given text. Students are required to design a class that compiles features from a given text, such as word lengths, sentence lengths, and distribution of word-stems. They then use these features in the Naive Bayes algorithm to classify texts. In addition to reviewing string manipulation, this project requires students to design and document a class. It is particularly useful for students who need additional practice with strings and class design.

Connect Four: The Player class

In this assignment students work either individually or in pairs to implement an AI Player class for the game Connect 4. Students must write a class that recursively chooses the optimal move in the game Connect 4 given a board and the number of moves to look ahead. In addition to having students write a recursive algorithm, this assignment also requires students to design a class. It is particularly useful for students who need additional practice with recursion and classes.

Connect 4 Board

In this assignment students work individually or in pairs to write a class that represents the board in the game Connect 4. Students must use a two-dimensional array to represent the board and write methods that initialize the board, check whether a move is allowed, check if the board is full, place a marker in a column, undo a move, check whether a player has won, and run a loop that plays the game. This assignment requires students to write a class and work with multidimensional arrays. It is particularly useful for students who need additional practice designing classes and performing operations on multidimensional arrays.

Markov Text Generation!

In this assignment students work either individually or in pairs to implement Markov text generation. Students must prompt the user for files to use as a model and then parse the files to create a k-th order Markov model, represented as a map of key words to the k words that can follow those words. Students then generate a random text using this map. In addition reviewing strings, dictionaries, and file i/o, this assignment requires students to design their own algorithm given basic specifications.

Fun with Functions

In this assignment students individually or collaboratively use recursion to write Python functions. Students compare the assigned recursive functions with those that were previously written (and are included with the activity). As an added support the assignment includes information about an online Python visualizer that can be used to help create a visualization of the recursive calls to facilitate deeper understanding of this fundamental CS topic. This activity is particularly useful for students who have some experience with creating functions and are interested in getting more experience and exposure to recursion.

Functioning in Python

In this lab students work independently or collaboratively to develop a deeper understanding of using pre-defined and building custom functions within Python. Through the implementation and analysis of six functions, students practice creating docstrings to describe both the functionality of each function and the inputs associated with each function. Each function illustrates a particular core feature within Python (such as performing calculations, interpolating values, executing checksums). This lab is particularly useful for students with little experience writing functions and for those interested in more practice using pre-defined functions.

Dealing with Data in Python

In this lab students work independently or collaboratively on slicing and indexing Python values to develop a fundamental understanding of lists. Using the Python interpreter (or shell), students begin by exploring rudimentary topics in programming using arithmetic operators, string manipulation, and list expressions. After sufficient time has been spent exploring the basic operation of the interpreter, students are to compose multiple lists from two pre-defined lists, pi and e, and perform some list operations. This lab activity is useful for students who are new to lists.

Subscribe to HTML