Send me a 1-paragraph project proposal when you have chosen a project idea (either one of these, or your own idea). I will either approve your idea or may ask you to choose another idea if yours seems too easy or too difficult.
You may write your program in Pascal or, if you like, in C or C++ if you know one of those languages already.
You must send your idea to me by December 31, 2017.
You must submit the final version of your program by February 18, 2018 (the end of the exam period).
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.
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.
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.
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.
Convert Pascal source text to HTML, formatting it nicely and highlighting keywords.
Obfuscate Pascal source code:
remove all comments
remove unnecessary spaces
change variable names to x1, x2, x3 …
format the code to a desired line length
The resulting program should be equivalent to the original: it should compile and run with the same effect.
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.
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.
The program's input is a file containing the daily prices of a single stock. Consider the following trading rules:
If the price is more than K1 times its price D1 days ago, buy.
If the price is more than K2 times its price D2 days ago, sell.
If the price is less than K3 times its price D3 days ago, buy.
If the price is less than K4 times its price D4 days ago, sell.
If the price is less than K5 times the price you paid for it, sell.
If the price is more than K6 times the price you paid for it, sell.
If the price is less than K7 times the price you last sold at, buy.
If the price is more than K8 times the price you last sold at, buy.
“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.
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.
Read a Pascal source file and its units and write out a table indicating which units use which units.
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);
)
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.
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.
For two players, with an AI that can play as well.
Given a current chess position and a player whose turn it is to move, determine whether checkmate in two moves is possible.
Play a chess endgame so that a king and rook can checkmate a solitary king.
Implement a simple Rogue-like game with text-mode graphics.
The game of Mastermind.
The game of Checkers (also known as Draughts).
The card game Mau mau.
The game Take 5!.
The game Bang!. You may wish to implement only a simplified version of the rules.
The game Chain Reaction.
The game Battleship.
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.
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.
Solve Sudoku problems.
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
a time when a sentence was spoken in the actual film
a time when the sentence appears in the subtitle file
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.
The game Minesweeper.