← All projectsCOSC 1 / Software

Python exercises

Early assignments in graphics, recursion, and search.

Four-by-four chessboard with four red queen markers in nonattacking positions
Saved N-queens assignment screenshot. The course supplied the board interface; the exercise focused on validating placements. View full size (new tab): Four-by-four chessboard with four red queen markers in nonattacking positions

Checking an N-queens board

The board is a list of lists of Boolean values. The validation code checks rows, columns, and the two diagonal directions for attacking queens. The graphical interface lets a user toggle squares, so the same checks can be tried on valid and invalid arrangements.

Searching and keeping state

Other short assignments cover binary search, counters, timers, and a graph-based text adventure. They introduced different ways to represent state: a shrinking search interval, an object’s fields, or the current vertex in a story graph.

Course scaffolding

These are early exercises rather than a single application. Several use supplied graphics and testing code, including cs1lib and the N-queens board interface. The repository retains the original course credits.

Mithun RameshkumarDartmouth College