Here are some programs, mostly games, that I have written in C after attending an introductory course in C programming at the KTH Royal Institute of Technology in Stockholm, during the autumn of 2010. The files are compressed using 7zip and contain a windows executable file (.exe) and in some cases other supporting files. If you do not have 7zip, you can download it from here.

Click on the name of the program that you wish to download.
Name, date, and timeLinesSizeDescription
Hangman
07 Dec 2011 12:37
493 19 kb Hangman is of course the classic game where the player's friend is about to be hung but the player can save his/her friend by guessing a word in a limited number of attempts. This project was the first I wrote after finishing the introductory course in C programming that I took and since I was quite green as a programmer at the time (and I still am!), it took some time but I learned a lot. It is in English and I have taken many words just from news articles on the web, but I have also deliberately searched for long words to add to the game. A classic which is instantly recognizable. Here is information on the game idea on Wikipedia.
Bulls and cows
07 Dec 2011 12:37
416 17 kb Bulls and cows is a master-mind like game, with numbers, that I wrote in a reasonably short amount of time. I had expected it to be more of a challenge, but what I initially thought was going to be trouble turned out to be quite simple to overcome. A simple game that can be quite addictive though. Here is information on the game idea on Wikipedia.
Drugwars
02 Apr 2013 11:32
1,645 69 kb Drugwars is my largest and most complex project to date. The game is a classic and the purpose is to get as rich as possible by selling drugs. When I thought of writing this game I first thought it would be too complex, but after some thinking and planning to keep it simple I did it. The game comes with a five-page manual, not only to explain the game but also my thinking behind some solutions in it. For those who have played it in the past, please remember that this is my take on the game and it is not exactly as you have played it before. Here is information on the game idea on Wikipedia.
Yahtzee
03 Dec 2012 16:55
968 21 kb Yahtzee is a classic dice game based on older dice games and to some extent on poker rules. I chose to write a Yahtzee program because since my drugwars project I had not written anything in C, which was for a few months and I thought that Yahtzee would be a suitable challenge. The rules for Yahtzee can be downloaded as a pdf from here, from Hasbro who today own the game.
vcf splitter
07 Dec 2012 11:19
331 18 kb vcf splitter is not a game but a program for splitting a single vCard (.vcf) file containing multiple contacts into multiple smaller files; one file for each contact. I discovered the need for this program after I had exported all contacts from my android phone into a single .vcf file, but Outlook could only read the first entry and I realised that I needed to split the file into one file for every contact.
Yahtzee multiplayer
15 Dec 2015 12:15
1,526 56 kb Yahtzee multiplayer is a deveopment of the Yahtzee project above. It allows for up to six players and introduces some new features such as being able to see after a game how the scores changed round by round during the game. There are also some technical changes but the user will not notice them.
Drugwars with audio!
15 Dec 2015 11:23
1,712 448 kb Drugwars with audio! Basically this is still the same game as Drugwars, but with added sounds. I have added some wave sounds files to spice up the gunfights and a little tune when the player gets into trouble. The MIDI melody used in the program is generated by the program itself and, unlike the waves, does not come from an external file. All sounds are played using the Win32 API.
2048 - mdv version
19 Mar 2018 15:17
898 217 kb 2048 - mdv version My version of the math puzzle game 2048, includes save function. It is really simple but really addictive! As in my previous games I have included a high-score list. Information on Wikipedia: 2048
Sokoban
30 May 2016 10:54
1,694 55 kb Sokoban is a popular puzzle game from the 80s. I was more interested in coding than in level design, so the game requires pre-made level files to be imported. To acheive this, I had to write a little file and level manager which was quite interesting in itself. I also added the functionality of saving progress in-game since some of the levels people write can be very large. Info on Wikipedia is here.
Cursor
06 Feb 2017 08:10
638 78 kb Cursor is my first GUI program, written using the Win32 API. It is a utility for preventing screen savers from activating. It works by moving the mouse cursor after a set interval of inactivity.
2048 - GUI version
19 Mar 2018 15:14
1,745 330 kb 2048 - GUI version is the GUI version of my previously written version of 2048. Of course some changes have been made in general but the biggest change is that this version has been written for the win32 GUI.

'Lines' are lines of actual code, not counting empty lines or lines with comments only.
© 2003 - 2018 Martin de Verdier