ABGTE2 confusion

new topic     » topic index » view thread      » older message » newer message

------=_NextPart_000_0007_01C01329.4CFE6060
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I looked at a demo in ABGTE2 (D2004a) and found it very interesting but =
also confusing. There seems to be variables in there that haven't been =
declared, but are used anyways:

include image.e
include graphics.e
sequence ball, bounce
bounce =3D
25, --Does this determine where the ball=20
,    -- bounces?
,
if graphics_mode(18) then
     puts(1, "Mode Set Failure")
else
     clear_screen()
     ellipse(5, 1, {200,200}, {300,300})
     for iy =3D 234 to 266 do            --What is iy and ix? They =
haven't been declared.*
          for ix =3D 200 to 300 do
               if get_pixel({ix, iy}) =3D 5 then    --*
                    pixel(15,{ix, iy})                --*
                  end if
          end for
     end for
     for iy =3D 267 to 300 do
          for ix =3D 200 to 300 do
               if get_pixel({ix, iy}) =3D 5 then
                    pixel(9,{ix, iy})
               end if
          end for
     end for
     ball =3D save_image({193,193},{308,308})            -- Where was it =
that the picture of ball was created?
     clear_screen()
     position(1,1)
     puts(1, "Press q to end this bouncing ball demo!")
     while 1 =3D 1 do
          if get_key() =3D 'q' then
               exit
          end if
          for ix =3D 1 to length(bounce) do
               display_image({270,bounce[ix]},ball)
          end for
          for ix =3D length(bounce) to 1 by -1 do
               display_image({270,bounce[ix]},ball)
          end for
     end while
     if graphics_mode(-1) then
          puts(1, "Mode Set Failure")
     end if
end if

Thanks for  your help.=20

-Thomas

------=_NextPart_000_0007_01C01329.4CFE6060
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial>I looked at a demo in ABGTE2 (D2004a) and found =
it very=20
interesting but also confusing. There seems to be variables in there =
that=20
haven't been declared, but are used anyways:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>include image.e<BR>include =
graphics.e<BR>sequence=20
ball, bounce<BR>bounce=20
3.75,226.25,&nbsp;--Does=20
this determine where the ball=20
.125,&nbsp;&nbsp;&nbsp;=20
--=20
R>if=20
graphics_mode(18) then<BR>&nbsp;&nbsp;&nbsp;&nbsp; puts(1, "Mode Set=20
Failure")<BR>else<BR>&nbsp;&nbsp;&nbsp;&nbsp;=20
clear_screen()<BR>&nbsp;&nbsp;&nbsp;&nbsp; ellipse(5, 1, {200,200},=20
{300,300})<BR>&nbsp;&nbsp;&nbsp;&nbsp; for iy =3D 234 to 266 =
do&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --What is iy and ix?&nbsp;They =
haven't=20
been =
declared.*<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for =
ix=20
=3D 200 to 300=20
nbsp;&nbsp;&nbsp;=20
if get_pixel({ix, iy}) =3D 5 then&nbsp;&nbsp;&nbsp;=20
pixel(15,{ix, iy})&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
end if<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end=20
for<BR>&nbsp;&nbsp;&nbsp;&nbsp; end for<BR>&nbsp;&nbsp;&nbsp;&nbsp; for =
iy =3D 267=20
to 300 do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for =
ix =3D 200=20
to 300=20
nbsp;&nbsp;&nbsp;=20
if get_pixel({ix, iy}) =3D 5=20
pixel(9,{ix,=20
;&nbsp;&nbsp;&nbsp;=20
end if<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end=20
for<BR>&nbsp;&nbsp;&nbsp;&nbsp; end for<BR>&nbsp;&nbsp;&nbsp;&nbsp; ball =
=3D=20
save_image({193,193},{308,308})&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; -- Where was it that the picture of ball was=20
created?<BR>&nbsp;&nbsp;&nbsp;&nbsp; =
clear_screen()<BR>&nbsp;&nbsp;&nbsp;&nbsp;=20
position(1,1)<BR>&nbsp;&nbsp;&nbsp;&nbsp; puts(1, "Press q to end this =
bouncing=20
ball demo!")<BR>&nbsp;&nbsp;&nbsp;&nbsp; while 1 =3D 1=20
do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if =
get_key() =3D 'q'=20
;&nbsp;&nbsp;&nbsp;=20
exit<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end=20
if<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for ix =3D =
1 to=20
length(bounce)=20
nbsp;&nbsp;&nbsp;=20
sp;&nbsp;&nbsp;&nbsp;=20
end for<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for ix =
=3D=20
length(bounce) to 1 by -1=20
nbsp;&nbsp;&nbsp;=20
sp;&nbsp;&nbsp;&nbsp;=20
end for<BR>&nbsp;&nbsp;&nbsp;&nbsp; end =
while<BR>&nbsp;&nbsp;&nbsp;&nbsp; if=20
graphics_mode(-1) =
puts(1, "Mode Set Failure")<BR>&nbsp;&nbsp;&nbsp;&nbsp; end if<BR>end=20
if<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Thanks for&nbsp; your help. =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>

------=_NextPart_000_0007_01C01329.4CFE6060--

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu