# compatibility with TI-83+/84P CE Python edition from ti_graphics import cls, setColor, setPen, getPixel, setPixel, drawString, drawLine, drawPolyLine, fillPolygon, drawRect, fillRect, drawArc, fillArc, fillCircle try: from ppn_all import * ppn_y0, ppn_w, ppn_h = 30, 320, 210 # for Casio fx-CG / USB Power Graphic 3 + NumWorks scripts def get_pixel(x, y): return x >= 0 and x < ppn_w and y >= 0 and y < ppn_y0 + ppn_h and getPixel(x, y + ppn_y0) def set_pixel(x, y, c): setPixel(x, y + ppn_y0, c) def draw_string(x, y, s, c=(0, 0, 0), t=None): setColor(c) drawString(s, x, y + ppn_y0) show_screen = lambda: None # Ndless # for Casio fx-CG / USB Power Graphic 3 scripts clear_screen = cls # for NumWorks scripts def fill_rect(x, y, w, h, c): setColor(c) fillRect(x, y + ppn_y0, w, h) # for TI-Nspire Ndless scripts def getPx(x, y): return x >= 0 and x < ppn_w and y >= 0 and y < ppn_y0 + ppn_h and col_lst2int(getPixel(x, y + ppn_y0)) def setPx(x, y, c): setPixel(x, y + ppn_y0, col_int2lst(c)) def fill(c): setColor(col_int2lst(c)) fillRect(0, ppn_y0, ppn_w, ppn_h) except: myInternalException('CE')