Unlike most people today, I have a personal website. This is it. I have had my own site since 1996 and it has been on this domain - mdv.se - since 23 August 2003. It will never be very useful or finished, though I would not call it a work in progress, since there is nothing really to progress towards.

At the moment I use it to share some programs I have written in C/C++. I know that there are many services I could use for doing that, but I neither aim to reach as many people as possible - mainly just myself and maybe a friend or two - nor to have the services ready-made and served up for me. I want to create my own solutions.

Mostly though, I hang on to this domain for the e-mail addresses I have on it. Since I have the domain however, I wanted to put something here.


| programs | home

After attending an introductory course in C programming at the KTH Royal Institute of Technology in Stockholm, during the autumn of 2010, I started writing programs in C. Here are some of them, plus some written in C++. The files are compressed using 7-zip and contain a Windows executable file (.exe) and in some cases other supporting files.

When I think that a program is ready enough I put it here. However, I may still improve on it if I think of something - and I do, sometimes years after I first put it here. I also choose to not put some of the things I write here if I think that they are too simple or interesting only to me. For example, I really liked a dll I wrote with support functions for an Excel macro I made, but that is pretty much useless without that macro - and the need for that macro in the first place. I have also written a relatively large program for controlling the lights in our home, but that is not general enough to be of use to anyone else.


Click on the name of the program that you want to download.

Click on image to close it
Name Lines Size Description Screenshot
493 19 kb The classic pen and paper game where the player must save their friend by guessing a word in a limited number of attempts. This project was the first I wrote after finishing the course at KTH, so it took some time but I learned a lot. It is in English and I have taken many words just downloading entire news articles on the web, but I have also deliberately searched for long words to add to the game. Wikipedia link.
416 17 kb A master-mind like game, with numbers, that I wrote in a reasonably short amount of time. A simple game that can be quite addictive though. Wikipedia link.
1,645 57 kb This game is a classic. 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 it was alright. I have written a five-page manual, not only to explain the game but also my thinking behind some solutions in it. Please note that this is my take on the game and it differs from earlier versions on purpose. Wikipedia link.
968 21 kb The dice game based on older dice games and to some extent on poker rules. I chose to write a Yahtzee program because after my Drugwars project I had not written anything in C 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.
331 18 kb This is a program for splitting a single vCard (.vcf) file containing multiple contacts into multiple smaller files; one file for each contact. I had a need for a program like this 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. I was not going to do that manually, was I?
1,526 56 kb The Yahtzee project above is just single-player. This version allows for up to six players and introduces some new features which make sense with more players. There are some technical changes too but the user will not notice them.
1,712 448 kb Basically this is the same game as Drugwars, but with added sounds. I have added some wave sound 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.
838 217 kb My version of 2048. It includes a save function. It is really simple but really addictive! Wikipedia link.
1,895 1,015 kb When I wrote this I was more interested in coding than in level design, so the game requires pre-made level files to be imported, and some are included. To work well with external files, I wrote a file and level manager, which was interesting in itself. I also added the ability to save since some of the levels can be very large. Wikipedia link.
1,303 159 kb 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 selectable interval of inactivity. Updated in June 2024.
1,737 332 kb GUI version of my previously written 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.
1,895 1,208 kb This is the same project as Sokoban but this version comes with an installer that puts all files where they are supposed to be, creates start menu shortcuts and provides an uninstaller.
4,873 5,136 kb Still very much a beta version. I wanted to make a GUI version of my Sokoban game and while the basic functionality is still the same, I decided to add a few new things - for example an integrated MIDI player! Try it and see!
1,930 153 kb My version of the classic MS Minesweeper, that was first released in 1990. A fun project that I tried to make very true to the original although I did make a few, very small alterations that are probably not noticeable. There is a bug that is most prominent in Expert mode that I will have a look at when I have time...
Wikipedia link.
1,251 365 kb This is a program that renames media files to random names. This project is based on some batch files that I wrote many years ago since I had a cheap mp3 player that could not shuffle songs and just played them in alphabetical order, so if I randomly renamed the files, I had my own randomised playing order!
I have changed the bat files over the years to work with image files too and while I was writing this anyway, I thought that I should include support for video files too (it really works with any files, the file types are more presets since it is just a renaming utility).
2,519 1,396 kb When using Photo Mode in Red Dead Redemption 2 for PC, a "PRDR" file is created. This program extracts the jpeg data embedded in that file, along with some metadata that the game includes in the PRDR file, and saves to a JPEG image file.
996 1,351 kb This project is a bit of a cheat.. I wanted to rename the files produced by the photo mode in Cyberpunk 2077, so I re-used a lot of the code from my RDR2 project. I would say that 95% of the code in this project is copied from that project. Anyway, since the naming of the files from Cyberpunk 2077's photo mode included the datestamp DDMMYYY, files went out of chronological order when sorted by name so I wrote this program to fix that. It copies the files by the way, keeping the originals.

'Lines' are lines of actual code, not counting empty lines or lines with only comments.

| programs | home