Project ideas for Programming I, winter semester 2016/17

Some of the ideas below involve implementing games. For these, you could allow a player to play against another person and/or against an AI computer player.

diff

Read two files, compare them line by line and generate an HTML file that uses CSS styles to indicate lines that were added or removed from the first file to the second.

word diff

Read two files, compare them word by word and generate an HTML file that uses CSS styles to indicate words that were added or removed from the first file to the second.

find duplicate files

Search in a given directory and its subdirectories, looking for files that have the same size, date/time, contents and/or name. The user should be able to specify which of these attributes should be used to detect duplicates.

pretty printer

Convert Pascal source text to HTML, formatting it nicely and highlighting keywords.

code obfuscator

Obfuscate Pascal source code:

The resulting program should be equivalent to the original: it should compile and run with the same effect.

algorithm animation

Use text-mode graphics to animate one of the algorithms we've studied in this class, such as we saw for the Tower of Hanoi.

stock analyzer 1

The program's input is a file containing the daily prices of a single stock. Find and print out the single pair of days b and s that will yield the maximum profit if a user buys the stock on day b and sells on day s.

stock analyzer 2

The program's input is a file containing the daily prices of a single stock. Consider the following trading rules:

“Buy” means to buy shares for all your available money. “Sell” means to sell all shares you own.

For any given values of K1...K8 and D1...D4 it is easy to compute the net gain or loss (we assume that the trader sells all shares after the last day). The program should search for the values K1...K8 and D1...D4 that maximize profit.

Pascal cross reference

Read Pascal source code and write out a table indicating which functions/procedures call which functions/procedures. It should indicate functions/procedures that are not called at all.

Pascal unit cross reference

Read a Pascal source file and its units and write out a table indicating which units use which units.

string constants

Read a Pascal source file and convert all string constants (e.g. write('abc'); ) to similarly named constants that are defined at the beginning of the program (e.g. const txABC = 'abc'; … write(txABC); )

consecutive words

Read a (long) text file and write out a table showing how many times each consecutive pair of words appears in the file, sorted in descending order by frequency.

related words

Read a (long) text file and write out a table showing how many times each pair of words occurs in the same sentence (not necessarily consecutively), sorted in descending order by frequency.

Tic Tac Toe

For two players, with an AI that can play as well.

mate in two

Given a current chess position and a player whose turn it is to move, determine whether checkmate in two moves is possible.

mate with king and rook

Play a chess endgame so that a king and rook can checkmate a solitary king.

Rogue

Implement a simple Rogue-like game with text-mode graphics.

Mastermind

The game of Mastermind.

checkers

The game of Checkers (also known as Draughts).

mau mau

The card game Mau mau.

take 5

The game Take 5!.

Bang!

The game Bang!. You may wish to implement only a simplified version of the rules.

chain reaction

The game Chain Reaction.

Battleship

The game Battleship.

specific calculator

The program should behave exactly like a certain electronic calculator (of your choosing). That is, the same key sequences should yield the same display output.

paper folding

Read numbers M and N and compute the number of possible ways in which a piece of graph paper of dimensions M x N can be folded into a single cube.

Sudoku

Solve Sudoku problems.

subtitle synchronization

Files containing subtitles are common online, but sometimes the timing is wrong when you try to use these subtitles with an actual movie, because the subtitles may have been generated using a copy of the movie that has a longer or shorter introduction or which even plays at a slightly different speed. Develop a utility to adjust the times in a subtitle file to match a particular recording of a movie.

Specifically, the program's input will be a file containing subtitles for a particular movie, plus two pairs of times for synchronization. Each pair contains

The program should adjust the speed and offset of the subtitle file so that the two given sentences (and hopefully all others) occur at the same time in the subtitle file as in the movie.

Minesweeper

The game Minesweeper.