MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1y5vntt/technicallycorrect/19t8ccvhda91c/?context=3
r/ProgrammerHumor • u/Apprehensive_Bit7392 • 19h ago
42 comments sorted by
View all comments
Show parent comment
8
Can simplify the middle two a tad by reflecting the lines at the middle, instead of trying to model the diagonal with the offset
if min(row, col) == 0 || col+1 == WIDTH || row+1 == HEIGHT { fmt.printf("#") } else if col == min(HEIGHT-row-1, row) || col == max(HEIGHT-row, row+1) { fmt.printf("#") } else { fmt.printf(" ") }
View all comments
Show parent comment
8
u/etoastie 8h ago
Can simplify the middle two a tad by reflecting the lines at the middle, instead of trying to model the diagonal with the offset