Showing posts with label AS3. Show all posts
Showing posts with label AS3. Show all posts

Saturday, May 26, 2012

Mandelbrot fractal viewer

One of the first things I did when I got my computer was to render the Mandelbrot Set fractal. This was centuries ago, and I did it in C using DOS Borland-C++ and its fabulous (for me at that time) graphics library. I played a lot plotting lines and points on the screen those days. I don't know why exactly but this program has been always in my heart, maybe due to the colorful images it gave me:


Wednesday, February 9, 2011

Solving the Tic-Tac-Toe game, finally...

The simple game that has been always after me laughing at my programming incompetence.

The very first time I tried to make a program that could play perfectly the game was in the university, after taking my very first course in Programming Languages (I learned Pascal). It was holidays and I was visiting my cousin and got the nice surprise of him getting a personal computer. It was a powerful 286 with a monochrome amber monitor. I couldn't find anything similar but for you to get the idea, games were played like this in those computers:

Thursday, July 29, 2010

The Princess in a Box puzzle

Today was holidays here (national day) so I finally could finish the Professor Layton and the Curious Village cute little game. If you like puzzles there are no better games than the Professor Layton series. I really recommend them if you own a Nintendo DS. However I don't play games much, so take my advice with a bit of salt: the only games I ever finished were StarControl II, Starcraft and Jeanne d'Arc. That reminds me that the last time I went to Buenos Aires I brought with me a little box with a similar puzzle. I totally forgot about it until I saw again a similar puzzle in the DS game.

This puzzle has been a long time around us as a member of the family of sliding puzzles and is better known as the Klotski puzzle, but I'm going to name it here The Princess in a Box puzzle because is the name that it has in the Professor Layton's game. I did this Flash demo if you want to play it:

Saturday, July 11, 2009

Solving simple International Mathematical Olympiad problems.

Solving simple International Mathematical Olympiad problems by programming is a sadistic stress reliever. They were originally thought to be solved using only paper, pencil and lots of young and smart neurons. Let's amuse ourselves solving them with a bit of code. Afterall, Why not to use the nukes? :D

Sunday, July 5, 2009

IMO 1959 Problem 04

The year is 1959. The place: Braşov, Romania, where the first International Mathematical Olympiad is being held. The problem is short, simple and sweet:
Construct a right-angled triangle whose hypotenuse c is given if 
it is known that the median from the right angle equals the 
geometric mean of the remaining two sides of the triangle.

The mathematical solution is left as an exercise, because you can use the brute force Luke. :D




Cheers.

Friday, July 3, 2009

Particiones enteras

Celebrando el hecho de que ya termino con mi primer ciclo de la maestría, y que ademas he conseguido el titulo de experto en ProjectEuler haré un post acerca de un problema que me parece interesante. El enunciado es bien simple:

Dado un numero entero "n" ¿De cuantas maneras diferentes se puede descomponer "n" en números enteros positivos?.

La solución aunque simple no es evidente.
Por ejemplo, sea n = 4.
4 puede descomponerse en: ( 1 + 1 + 1 + 1 ), ( 1 + 2 + 1 ), ( 3 + 1 ), ( 2 + 2 ) y ( 4 ). Cada una de estas sumas es una partición entera de 4. Como buscamos solo particiones diferentes hay algunas que no se consideran, por ejemplo, no se esta considerando ( 2 + 1 + 1 ) porque es lo mismo que ( 1 + 1 + 2 ) si ignoramos el orden.
Es fácil entender de donde viene el nombre de partición entera, lo que estamos haciendo es "partir" el numero 4 en agrupaciones diferentes:
Vemos que el numero de formas diferentes en que se puede descomponer 4 es 5.