Unofficial MT258
Diary of C Programming study
Welcome. These web-pages were written at the time I was starting to learn C. Here you'll find some of the programs I wrote for fun or for assignment purposes. Most programs are written for console mode in DOS. Source codes and the executable files are provided for download if suitable. The source codes are not intended to be "model answers" for other programming students in their assignments. (There is no single correct solution in programming.) As the title reads, this is a diary recording my path in learning C. I am not satisfactory with some of the programs but I put them up anyway. History is history.
|
|
ACM International Programming Contest |
*** Below are some programs I wrote while I was learning C. Free to download. ***
JumBall |
download Description: A very additive IQ game that is easy to learn but nearly impossible to master. Balls will jump by itself to locations on your order. You line up 5 balls of the same color in a row then the balls will be eliminated. But new balls are falling down constantly. You have to be efficient in clearing out balls before the board become overcrowded. Requirement: win95, 98, NT4.0, 2000 or above Remarks: Installer and Uninstaller included. |
![]() |
Calendar Maker | ![]() |
download Description: You enter a number which is the year then this program will output the whole year calendar, month by month, to a text file. You can use whatever editing tool to designate the font and print it. Requirement: DOS 5.0, win95 or above Usage: Run it in a DOS command window. |
![]() |
File Cutter |
free download Description: Cut files into any size or any number of parts you want. Automatically create a batch file for easy combination of parts. Facilitate internet transferal, floppy storage, etc. Requirement: win95 or above |
![]() |
Puzzle 5x5 | ![]() |
download version
1.0 Description: Arrange 24 squares on a board in correct order by moving squares around. Requirement: DOS 5.0, win95 or above Usage: Run it in a DOS command window. |
![]() |
Blackjack Card Game | ![]() |
download version 1.0 Description: This is a card game for a player to play with the computer. Text-graphic user-interface. Designed according to international casino rules. |
![]() |
Requirement: win95 or above
Usage: Run it in a DOS command window.
Celsius - Fahrenheit Conversion | ![]() |
Description: A very simple program that converts temperatures between Celsius and Fahrenheit. Inputs are fully checked so that users are not allowed to key-in garbages.
Requirement: DOS 5.0, win95 or above
Usage: Run it in a DOS command window.
Game of Life | ![]() |
Description: LIFE is a simulation game. It simulates the birth and death of organisms in a community by a set of simple rules. Players are allowed to design their own communities and see how the community grows up or dies out or comes to an equilibrium. | ![]() |
More about LIFE and download v1.0a
GCD & LCM Finder | ![]() |
Description: This is a finder for GCD (Greatest Common Divisor), sometimes called HCF (Highest Common Factor), and LCM (Lowest Common Multiple).
This utility calculates GCD & LCM of two or MORE integers. Most calculators do not have this function. This program is a great complement.
Requirement: win95 or above
Usage: Run it in a DOS command window. Define how many numbers you will input, then key in the numbers. If you want to quit before finishing, you can press ctrl-c to exit.
Text Trimmer | ![]() |
download version 1.0
There's another windowed version I wrote previously. It's called Text Condenser. It trims texts in a more configurable way. download Text Condenser 1.0 for Windows |
![]() |
Description: Text Trimmer reduces multiple empty line spacings in text files into single empty line spacings, thus compressing the lenght of some texts and saving paper when you want to print them out.
Requirement: win95 or above
Usage: Run Text Trimmer in a DOS command window. Run Text Condenser in Win95 or above. Note: only text files are supported.
Days-Between-Dates | ![]() |
Description: This program will find out how many days are there between any two dates (inclusive). For example, do you know how many days have you lived? This program can give you an answer immediately.
Requirement: win95 or above
Usage: Run it in a DOS command window. Enter year (e.g. 2000), month (1 for Jan, etc.) and date (1 to 31) for starting and ending dates.
Day-of-week Calculator | ![]() |
Description: This program can find out the day-of-week of any date in any year. If an invalide date is entered (e.g. 30 Feb) it will issue a message notifying the user of the error.
The idea of this program comes from an assignment exercise. The original exercise is too simple -- requiring students to calculate day-off-week in one specific year only. I extended the idea to calculate any date in any year with a different algorithm.
Requirement: win95 or above
Usage: Run it in a DOS command window. Enter year (e.g. 2000), month (1 for Jan, etc.) and date (1 to 31).
Prime Number Finder | ![]() |
version 1.0, version 2.0, version 3.0, Prime Number Tester source code of v1.0 Description: This program will find out all prime numbers in any range you specify. |
![]() |
Version 1.0 uses an array to store processed data. The range is preset in compile-time (pre-set to 1-1000). If you want to change the range, edit the source code and recompile.
Version 2.0 dynamically allocate memory to store processed data. Range can be specified in run-time.
Version 3.0 is similar to 2.0 but this one uses bit-units (rather than char) to store the status of numbers, thus allowing 8 times of numbers to be stored and processed, at the cost of slower speed.
Prime Number Tester is based on v2.0. It prompts for a number and test whether it is a prime number. If it is not prime, it lists all factors of this number.
Requirement: win95 or above
Usage: Run the Prime Finders in a DOS command window. The default setting is to output results to screen. If you want to save the results to a file (e.g. save in a file named output.txt) type
PRIME2 > OUTPUT.TXT
then enter a number as the limit. Press Enter twice. A file OUTPUT.TXT will be created.
n-Queen Puzzle Solution Finder | ![]() |
download v1.0
Description: The original puzzle is to find out how to place eight queens on a chessboard so that no queen can take another. This program can easily be adopted to find solution of any number of Queens in accordingly sized chessboards. |
![]() |
Requirement: win95 or above
Usage: Run it in a DOS command window. A text file will be created containing ALL possible solutions. The solutions should be read line-by-line like this:
for example: 2, 4, 1, 3. It means in the 1st column place a queen in row 2; in the 2nd column place a queen in row 4, etc.
If you edit the #define MAX 8 in the source code to another number, say 10, and compile again, this program will help you to find all solution of 10-Queen puzzle, i.e. placing 10 queens on a 10x10 chessboard without conflicts. Warning: if the number is set to over 12, the program may need to run for several minutes or hours or days, and will generate a big solution file. Be prepared for it.
Possible improvement: Future versions will accept run-time input of the number of queens to be solved.
Factor Finder | ![]() |
Description: List all factors of an integer
Requirement: win95 or above
Usage: Run it in a DOS command winodw. e.g type FACTORS 20, you'll get 1, 2, 4, 5, 10, 20
Sign Guestbook * View Guestbook
I reserve all copyrights to all programs and source codes published here. All materials are distributed freely for non-commercial uses. I assume absolutely no warranty of any kind for the materials.