#-------------------------------------------------------------- # Function to compute the x value of a line, given the y value # - since y=mx+b, this means x=(y-b)/m def lineXval (y, slope, intercept): return int((y-b)/float(m)) rows = 64 columns = 64 print "P3" print rows, columns print "255" # m = float(raw_input("Enter the slope of the line: ")) # b = float(raw_input("Enter the y-intercept of the line: ")) m = 1.5 b = -8 y = 0 while y < rows: x = 0 while x < columns: if x == lineXval(y,m,b): print "255 0 0", else: print "0 0 0", x += 1 print y += 1