1. Something Amusing

--------------A47D1051C4B0E973E0759CB2

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Here's something I just made. You need Euphoria 2.1 and both the files.</html>

--------------A47D1051C4B0E973E0759CB2
 name="boom.bmp"
Content-Disposition: inline;
 filename="Boom.ex"

include graphics.e
include get.e
include image.e
integer mode_succesful
mode_succesful = graphics_mode(259)
if mode_succesful = 1 then
    puts(1,"Sorry, graphics mode not supported.")
    abort(0)
end if
mode_succesful = graphics_mode(-1)
puts(1,"Creating atom 'Split'.\n\n")
atom Split
puts(1,"Atom creating succesful.\nGiving atom value of '50'.\n\n")
Split = 50
puts(1,"Would you like to split the atom??? (Yes No or Quit Y/N/Q)")
object key
key = 'b'
while key = 'b' do
    key = wait_key()
end while
if key = 'n' then
    mode_succesful = graphics_mode(-1)
    clear_screen()
    position(1,1)
    puts(1,"Okay")
    abort(0)
end if
if key = 'N' then
    mode_succesful = graphics_mode(-1)
    clear_screen()
    position(1,1)
    puts(1,"Okay")
    abort(0)
end if
object junk
sequence image
sequence colors
sequence original
global procedure delay(atom seconds)
    atom t1,t2
    t1=time()
    t2=0
    while t2<seconds do
        t2=time()-t1
        if t2<0 then t2+=86400 end if
    end while
end procedure
if key = 'y' then
    mode_succesful = graphics_mode(259)
    clear_screen()
    position(16,35)
    puts(1,"50")
    position(1,1)
    puts(1,"Press a key to split the atom")
    junk = wait_key()
    image = read_bitmap("boom.bmp")
    colors = image[1]
    colors = colors / 4
    original = get_all_palette()
    original *= 4
    all_palette(colors)
    display_image({1,1},image[2])
    delay(2)
    clear_screen()
    all_palette(original)
    position(16,35)
    puts(1,"25")
    junk = wait_key()
    if junk then
        mode_succesful = graphics_mode(-1)
        position(1,1)
puts(1,"You have just succesfully split the atom. Congratulations
        Einstein!")
    end if
    abort(0)
end if
if key = 'Y' then
    mode_succesful = graphics_mode(259)
    clear_screen()
    position(16,35)
    puts(1,"50")
    position(1,1)
    puts(1,"Press a key to split the atom")
    junk = wait_key()
    image = read_bitmap("boom.bmp")
    original = get_all_palette()
    original *= 4
    colors = image[1]
    colors = colors / 4
    all_palette(colors)
    display_image({1,1},image[2])
    delay(2)
    clear_screen()
    all_palette(original)
    position(16,35)
    puts(1,"25")
    junk = wait_key()
    if junk then
        mode_succesful = graphics_mode(-1)
        position(1,1)
puts(1,"You have just succesfully split the atom. Congratulations
        Einstein!")
    end if
    abort(0)
end if
mode_succesful = graphics_mode(-1)
clear_screen()
position(1,1)
puts(1,"N or Y only please.")
abort(0)


--------------A47D1051C4B0E973E0759CB2--

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu