Created
February 3, 2023 13:06
-
-
Save juliusgeo/6febc2e48a9821bc667fbc059e03a753 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
l=lambda\ | |
x0, y, x1, y1: \ | |
((dx := x1 - x0, dy := | |
y1-y,yi:=1,yi:=-1 if dy<0 else yi, | |
dy:=-dy if dy<0 else dy,d:=(2*dy)-dx,ps:= | |
set(),[(ps.add((x,y)),y:=y+yi,d:=d+2*(dy-dx))if d> | |
0 else(d:=d+2*dy)for x in range(x0,x1)]),ps)[1];pp=lambda \ | |
ps:list(map(print, [''.join(["-"if(x, y)in ps else" "for x in range | |
(127)])for y in range(10)]));pp(set.union(*[l(0, 0, i, 9) for i in range(37, 127)])) |
Author
juliusgeo
commented
Feb 3, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment