Programs

From MathMoth
Revision as of 15:56, 17 September 2017 by Admin (Talk | contribs)

Jump to: navigation, search

English Russian

Programming contests

The International Tournament in Informatics takes place in Shumen, Bulgaria every year at the end of November.

Online training

Sudoku solver

My teacher believes that Sudoku puzzles count as advanced math. My little program will help you also become an advanced learner.

PDP-11 Games

Before the era of widespread game consoles, people found ways to entertain themselves. The few who had computers made a few simple yet captivating text-based games. Now that retro gaming is becoming widespread, there is an excellent opportunity to bring these games back. Since almost nobody has a PDP-11 available nowadays, I have ported the best to Python and ncurses. They run on Linux and Mac OS, and under Windows with cygwin. They do not work on stock Windows because it does not have ncurses. The games are hosted on Savannah, but I have download links below as well.

Super Pacman

A pacman game. You dodge ghosts, eat dots, and eat ghosts if you have a power pellet. It has a scoreboard and ramping difficulty, and was the most popular of the games and the one I did first. The code is somewhat object oriented; the main loop polls all the objects in the game and has them do the appropriate actions. Download it here.

Xonix

A came about staking out bits of area while dodging ghosts. Claim enough area to move onto the next level. It uses a recursive flood fill algorithm to find what area you claimed. Thus, it requires a larger stack than Python allocates by default. Download it here.

Mars War

A simpler game. Fend off martians and protect your own troops. It presents an initial dialog to set the difficulty mode,adjusting the number of martians, their amount of movement and your launcher's defense capabilities. The code is quite object-oriented, with every sprite being an object. A good implementation would use a priority queue, but merely polling all the objects turned out to be sufficient. The original was probably written in a high-level language, because there are numerous variations. I've implemented an unified variant, taking the best parts of all I could find. Download it here.

1966 Snoopy Calendar

Everybody knows that a real programmer doesn't use Pascal, can write a 5-page loop without being confused, and has a 1966 Snoopy Calendar on the wall. The works of real programmers are still with us to cherish and imitate. But where's the calendar? This CGI script recreates the famous calendar from the mainframe era, which is also valid for the given year. Print the calendar and keep it on the wall. It will be useful again and again in the coming years.

Year:

Python

A one-line Python program can solve any problem.