/CLanguageGames

My first C games in command line window - minesweeper and bingo game!

Primary LanguageC

My first C games in command line window

  • Bingo game: You can execute bingo.exe. Enter 0 to fill the cells randomly. I just found some bugs to manually fill the cells, so don't try it. alt tag
  • Minesweeper game: You can execute minesweeper.exe. Enter the row number and column number to sweep the mine. For example, row 1 and column 9: enter 1 9.
    alt tag

They are all in Chinese language.


Little story about this minesweeper game:

After learning C language for one semester when I was a freshman (or should I say freshwoman?), it was the time close to final exams... "Hmm! I want to write a minesweeper game!" Suddenly I had this idea, and that's how this game had been produced. It was not that easy to me, since at that time I had not learned data structure and algorithms. However, it was so interesting to design and implement this game totally by myself (of course with the assistance of Google). I also shared it on my blog and got downloaded by so many people: http://blog.udn.com/gn01897234/2562496. The user interface is not that friendly, but at least I have tried my best to align the words.

Little story about this bingo game:

After finishing the minesweeper game, it was the winter vacation. And one day, again, I strongly wanted to write the bingo game, and that's why it's here again. This time it was more challenged. I remember I didn't know how to produce numbers 1 to 25 in a random order. By googling, I found an easy way called "shuffling" and implemented. Also, I even tried to install gcc on my little precious EEEPC, which was equipped with only 4 GB disk, just because I wanted to code this game when I was in my hometown without my desktop computer. Another challenge was, how should I play with computer? At that time, I had not learned data structure and algorithms, of coursed I did not know artificial intelligence. I came up with the idea to count the score for each row, column and diagonal by adding one if a number on the line was selected, so I simply choose the number with highest score, or randomly choose one if all numbers have the same score. I also shared my code on my blog again, and also got at least dozens of downloading: http://blog.udn.com/gn01897234/2807044.

I also found that I implemented and shared another two computer vision algorithms (not very "correct" methods, since I was just an immature freshman.): changing the brightness of the image and edge detection. They were also written in Chinese. Unfortunately I have not updated the blog for a long time and hided most of the articles.