Prime Remainders

This program calculates primes, takes their remainder┬╣ and then places a color accordingly. The shapes are quiet interesting.

Controls

  • Space takes a screenshot

p mod 10 p mod 255 p mod 500┬╣The formular for the color c at prime p with modulo m is c = p mod m. (m = 10 on the left, 255 on the right and 500 on the bottom)


# Python 2.7.7 Code
# Pygame 1.9.1 (for Python 2.7.7)
# Jonathan Frech 4th of November, 2015
#         edited 5th of November, 2015
#         edited 6th of November, 2015

Continue reading

Advertisements

Langton’s Ant

This program is a simulation of Langton’s Ant. The following image shows the ant on its highway.

Controls

  • F1 takes a screenshot
  • Space stops and resumes the ant’s movement

The highway is infinite...


# Python 2.7.7 Code
# Pygame 1.9.1 (for Python 2.7.7)
# Jonathan Frech 27th of October, 2015
#         edited 29th of October, 2015

Continue reading