grid_tron_like.py

Created by wperez274

Created on May 02, 2025

694 Bytes

Futuristic looking grid.


import math
import random
import kandinsky
import ion
import time
from time import sleep
from ion import *
from random import randint as R
from kandinsky import fill_rect as F


def show_grill():
  global SW,SH,gray,red,green,black
  global white,cyan,grill_gap,grill_line_c,bg

  SW=322
  SH=222
  gray=(200,)*3
  red=(255,0,0)
  green=(0,255,0)
  black=(0,0,0)
  white=(255,)*3
  cyan=(0,255,255)
  grill_gap=20
  grill_line_c=(0,0,150)
  bg=black
  F(0,0,SW,SH,bg)
#verticle lines, top to bottom
  for i in range(0,SW,grill_gap):
    F(i,0,1,SH,grill_line_c)
#horizontal lines, left to right
  for j in range(0,SH,grill_gap):
    F(0,j,SW,1,grill_line_c)


show_grill()

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.