PIX

From Esolang
Jump to navigation Jump to search
PIX
Designed by Mihai Popa
Appeared in 2024
Computational class Total
Major implementations PIX/Interpreter
File extension(s) .pix
A logo with 4 colored squares (red, green, blue and olive), a orange rectangle in the middle and pixelated text that says "PIX"
PIX's official logo

PIX is a esolang made by Mihai Popa. He wants a "fantasy console" that can only show graphics, so he came with a idea, and he called it PIX!

Specifications

It has 320×320 raster (or vector, depending on the implementation used) graphics, in 4, 16, 32 colors or full RGB.

Commands

Command list
Command Meaning Example
SM [mode] Sets screen mode to "4C" (4 colors), "16C" (16 colors), "32C" (32 colors) or "R" (full RGB) SM 16C
SC [index] #[hex] Sets color specified by a index number to a hex value SC 1 #0000ff
L [x] [y] [width] [height] [index, pallete] / #[hex, RGB] Draws a line L 5 15 50 60 3 / L 5 15 50 60 #0000ff
R [x] [y] [width] [height] [index, pallete] / #[hex, RGB] Draws a rectangle R 5 15 50 60 3 / R 5 15 50 60 #0000ff
E [x] [y] [width] [height] [index, pallete] / #[hex, RGB] Draws a ellipse E 5 15 50 60 3 / E 5 15 50 60 #0000ff
C [x] [y] [radius] [index, pallete] / #[hex, RGB] Draws a circle C 5 15 15 3 / C 5 15 15 #0000ff
S [x] [y] [size] [index, pallete] / #[hex, RGB] Draws a square S 5 15 15 3 / S 5 15 15 #0000ff
P [x] [y] [index, pallete] / #[hex, RGB] Draws a pixel P 5 15 3 / P 5 15 #0000ff
! [text] Single-line comment ! Will not be shown

Multi-line comments

Syntax is:

*(
Hello!
You are here.
Lorem ipsum.
Nǐ hǎo.
Blah blah blah...
更喜岷山千里雪,三军过后尽开颜。
Der schnelle braune Fuchs springt über den faulen Hund.
除数が 0 の除算、範囲外のパラメータを使用する関数 (例: arcsin(2))
)*

Note

PIX has the same resolution as a Palm Tungsten T PDA, 320x320 pixels.

Examples

Hello, TIC-80!

A more or less graphical version of Hello, world!

! We set the screen mode and pallete
SM 16C
SC 1 #ffffff
SC 2 #1a1c2c
SC 3 #29366f
SC 4 #41a6f4
SC 5 #f4f4f4
! We draw the actual picture
! Start
R 0 0 320 320 1
R 40 20 200 20 3
R 20 40 220 220 4
R 40 60 180 20 1
! Eyes
R 40 60 180 20 2
R 40 80 180 100 5
R 80 100 20 60 2
R 160 100 20 60 2
! Mouth
R 100 220 60 20 5
R 80 200 20 20 5
R 160 200 20 20 5
! Bottom
R 20 260 220 20 3
! Boots
R 40 280 60 20 2
R 160 280 60 20 2
! Tail
R 240 40 20 220 2
R 260 160 20 20 2
R 280 100 20 60 2

SM 4C
SC 1 #ff0000
SC 2 #00ff00
SC 3 #0000ff
SC 4 #ffff00
R 0 0 150 150 1
R 160 0 150 150 2
R 0 160 150 150 3
R 160 160 150 150 4

With padding at top-left

SM 4C
SC 1 #ff0000
SC 2 #00ff00
SC 3 #0000ff
SC 4 #ffff00
R 5 5 150 150 1
R 165 5 150 150 2
R 5 165 150 150 3
R 165 165 150 150 4

Minecraft's official site favicon

! Minecraft site icon
! Sets the colors
SM 4C
SC 1 #52a435
SC 2 #000000
! Drawing part
R 0 0 320 320 1
R 68 81 60 62 2
R 192 81 60 62 2
R 130 143 60 87 2
R 98 175 32 88 2
R 190 175 32 88 2

! PIX's official logo
! Sets the colors
SM 16C
SC 1 #000000
SC 2 #ffffff
SC 3 #ff0000
SC 4 #00ff00
SC 5 #0000ff
SC 6 #808000
SC 7 #ff8000
! Drawing part
! Start
R 0 0 320 320 2
! Squares
R 16 16 77 77 3
R 196 16 77 77 4
R 16 105 77 77 5
R 196 105 77 77 6
! Middle rectangle
R 115 80 50 60 7
! Text
! P
R 26 196 20 93 1
R 26 196 67 22 1
R 26 237 67 13 1
R 80 196 13 54 1
! I
R 116 195 25 95 1
! X
R 172 195 20 20 1
R 192 215 20 20 1
R 212 235 20 20 1
R 232 255 20 20 1
R 252 275 20 20 1
R 252 196 20 20 1
R 232 216 20 20 1
R 212 236 20 20 1
R 192 256 20 20 1
R 172 276 20 20 1

Interpreter

Please see PIX/Interpreter, in HTML, CSS and JS