jblog
toc

Caesar Cipher

2015-08-09, post № 54

programming, Pygame, Python, #black, #Caesar cipher, #Caesar's cipher, #cipher, #code, #coding, #crypt, #cypher, #decrypt, #decryption, #encoder, #encoding, #encryption, #hidden, #key, #message, #private, #secret, #secret message, #unbreakable

This program lets you write a short line and encrypt it using Caesar’s Cipher. It shows the two prior and next rotations, as well as the current encryption key.

Usage

  • Normal letters let you type text,
  • ‘Backspace’ lets you delete the last letter,
  • ‘Tab’ sets the encryption key to zero,
  • ‘Escape’ toggles if key and other rotations are shown,
  • ‘Return’ toggles if special characters (characters that are not contained in the standard alphabet) are displayed,
  • Up arrow rotates up (encryption key decreases),
  • Down arrow rotates down (encryption key increases).
caesar-cipher-1.png
caesar-cipher-9.png
caesar-cipher-7.png
Source code: caesar-cipher.py

JClock IV

2015-08-08, post № 53

programming, Pygame, Python, #alternative, #arc, #around the center, #background, #clock, #clockface, #displaying time, #draw, #rgb, #rgb clock, #rgbw, #spawn time, #time, #time display, #time reading

Combining the built-in Pygame function pygame.draw.arc() with time, I came up with this alternative clock design.
The red arc represents hours, the green one minutes, the blue seconds and the white arc represents centiseconds (a hundredth of a second).
Although it is a clock, you read it anti-clockwise.

jclock-iv-2.png
Source code: jclock-iv.py
Extra assets: jclock-iv-1.png

Pattern

2015-08-02, post № 52

programming, Pygame, Python, #art, #backgroud, #color, #colors, #diamond, #entities, #entity, #gradient, #move, #movement, #moving, #pipes, #wallpaper

Using colors and entities, this program can generate some nice-looking pictures. The entities move randomly across the screen, always staying in a grid layout. Their color is defined by an increasing tick variable, which gives them a nice gradient.

Controls

  • ‘Space’ spawns in new entities,
  • ‘m’ pauses and resumes the movement of entities.
pattern-1.png
pattern-2.png
pattern-4.png
Source code: pattern.py
Jonathan Frech's blog; built 2021/04/16 21:21:49 CEST