Procedure Ball(x,y:integer); begin circle(x,y,15); floodfill(x,y,clRed); end;
begin lockdrawing; for i:=1 to 20 do begin boy(100,200); Ball(100+i*5,200-i*5); ellipse(200,115,250,140); RedRaw; ClearWindow(clWhite); end; for i:=1 to 5 do begin boy(100,200); Ball(200+i*5,100+i*5); ellipse(200,115,250,140); RedRaw; ClearWindow(clWhite); end; for i:=1 to 25 do begin boy(100,200); Ball(225,125+i*5); ellipse(200,115,250,140); RedRaw; ClearWindow(clWhite); end; end.
from tkinter import *rt = Tk()
rt.title("Calculator")
rt.geometry("264x200")
rt.configure(bg="lightblue")
rt.resizable(width=False, height=False)_input = Text(rt, width=32, height=2
, font="arial 11")
_input.grid(row=1, column=0, columnspan=4)
class App:
def __init__(self, master):
self.master = masterdef add():
_input.insert(END, "+")
def sub():
_input.insert(END, "-")
def amp():
_input.insert(END, "*")
def div():
_input.insert(END, "/")
def n0():
_input.insert(END, "0")
def n1():
_input.insert(END, "1")
def n2():
_input.insert(END, "2")
def n3():
_input.insert(END, "3")
def n4():
_input.insert(END, "4")
def n5():
_input.insert(END, "5")
def n6():
_input.insert(END, "6")
def n7():
_input.insert(END, "7")
def n8():
_input.insert(END, "8")
def n9():
_input.insert(END, "9")
def clear():
_input.delete("1.0", END)
def eq():
txt = _input.get("1.0", END)
clear()
_input.insert(END, eval(txt))
b0 = Button(rt, bg="pink", text="0", width=8, height=2, command=n0)
b1 = Button(rt, bg="pink", text="1", width=8, height=2, command=n1)
b2 = Button(rt, bg="pink", text="2", width=8, height=2, command=n2)
b3 = Button(rt, bg="pink", text="3", width=8, height=2, command=n3)
b4 = Button(rt, bg="pink", text="4", width=8, height=2, command=n4)
b5 = Button(rt, bg="pink", text="5", width=8, height=2, command=n5)
b6 = Button(rt, bg="pink", text="6", width=8, height=2, command=n6)
b7 = Button(rt, bg="pink", text="7", width=8, height=2, command=n7)
b8 = Button(rt, bg="pink", text="8", width=8, height=2, command=n8)
b9 = Button(rt, bg="pink", text="9", width=8, height=2, command=n9)
add = Button(rt, bg="pink", text="+", width=8, height=2, command=add)
sub = Button(rt, bg="pink", text="-", width=8, height=2, command=sub)
amp = Button(rt, bg="pink", text="*", width=8, height=2, command=amp)
div = Button(rt, bg="pink", text="/", width=8, height=2, command=div)
eq = Button(rt, bg="pink", text="=", width=8, height=2, command=eq)
c = Button(rt, bg="pink", text="C", width=8, height=2, command=clear)
b0.grid(row=5, column=1)
b1.grid(row=4, column=0)
b2.grid(row=4, column=1)
b3.grid(row=4, column=2)
b4.grid(row=3, column=0)
b5.grid(row=3, column=1)
b6.grid(row=3, column=2)
b7.grid(row=2, column=0)
b8.grid(row=2, column=1)
b9.grid(row=2, column=2)
add.grid(row=2, column=3)
sub.grid(row=3, column=3)
amp.grid(row=4, column=3)
div.grid(row=5, column=3)
eq.grid(row=5, column=2)
c.grid(row=5, column=0)
rt.mainloop()
uses GraphABC;
var i:integer;
Procedure Boy(z,w:integer);
begin
rectangle(z-20,w-30,z+20,w+40);
MoveTo(z-20,w-20);
LineTo(z-35,w+15);
LineTo(z-20,w);
LineTo(z-20,w-20);
Floodfill(z-25,w,clBrown);
MoveTo(z+20,w-20);
LineTo(z+35,w+15);
LineTo(z+20,w);
LineTo(z+20,w-20);
Floodfill(z+25,w,clBrown);
Floodfill(z,w,clBlue);
MoveTo(z-10,w+40);
LineTo(z-10,w+70);
LineTo(z-3,w+70);
LineTo(z-3,w+40);
LineTo(z+3,w+40);
LineTo(z+3,w+70);
LineTo(z+10,w+70);
LineTo(z+10,w+40);
LineTo(z-10,w+40);
Floodfill(z-5,w+65,clBrown);
Floodfill(z+5,w+65,clBrown);
Circle(z,w-40,20);
Floodfill(z,w-40,clBrown);
end;
Procedure Ball(x,y:integer);
begin
circle(x,y,15);
floodfill(x,y,clRed);
end;
begin
lockdrawing;
for i:=1 to 20 do begin
boy(100,200);
Ball(100+i*5,200-i*5);
ellipse(200,115,250,140);
RedRaw;
ClearWindow(clWhite);
end;
for i:=1 to 5 do begin
boy(100,200);
Ball(200+i*5,100+i*5);
ellipse(200,115,250,140);
RedRaw;
ClearWindow(clWhite);
end;
for i:=1 to 25 do begin
boy(100,200);
Ball(225,125+i*5);
ellipse(200,115,250,140);
RedRaw;
ClearWindow(clWhite);
end;
end.