Skip to content

Instantly share code, notes, and snippets.

@nogajun
Created May 26, 2024 06:06
Show Gist options
  • Save nogajun/981b2d7e597c4cd220a0eaaf40fdfd1e to your computer and use it in GitHub Desktop.
Save nogajun/981b2d7e597c4cd220a0eaaf40fdfd1e to your computer and use it in GitHub Desktop.
ported from MSX Graphic workbook(1984) p.69 List 1a / MSXグラフィック・ワークブックからのPython移植
# ported from MSX Graphic workbook(1984) p.69 List 1a
import pyxel
size = 255
count = 36
step = size / count
color = pyxel.COLOR_WHITE
pyxel.init(size, size)
pyxel.cls(pyxel.COLOR_PURPLE)
for i in range(count):
pyxel.line(step*i, size, size, size-step*i, color)
pyxel.line(size-step*i, 0, size, size-step*i, color)
pyxel.line(size-step*i, 0, 0, step*i, color)
pyxel.line(step*i, size, 0, step*i, color)
pyxel.flip()
pyxel.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment