1. ABGTE2 confusion

------=_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 message » categorize

2. Re: ABGTE2 confusion

--
  --What is iy and ix? They haven't been declared.

  When you use a for loop you do not need to declare

  them. Simply using FOR anyvariablename allows you

  to use that name any where in that for loop until

  the END FOR.

  Bernie

new topic     » goto parent     » topic index » view message » categorize

3. Re: ABGTE2 confusion

------=_NextPart_000_0011_01C01344.D40B7B40
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Some quickie responses:
       for iy =3D 234 to 266 do            --What is iy and ix? They =
haven't been declared.*

  Loop counters don't have to be declared...

            for ix =3D 200 to 300 do
                 if get_pixel({ix, iy}) =3D 5 then    --*
                      pixel(15,{ix, iy})                --*  <-- Here's =
where the ball gets drawn
                    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?

------=_NextPart_000_0011_01C01344.D40B7B40
        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.2722.2800" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Some quickie responses:</FONT></DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: =
0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
  <DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp; for iy =3D =
234 to 266=20
  do&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --What is =
iy and=20
  ix?&nbsp;They haven't been declared.*</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT size=3D2><STRONG>Loop counters don't have to be=20
  declared...</STRONG></FONT></DIV>
  <DIV><FONT face=3DArial=20
  size=3D2><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 then&nbsp;&nbsp;&nbsp;=20
  =
  pixel(15,{ix, iy})&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
  &nbsp;&nbsp;&nbsp; --*&nbsp; <STRONG>&lt;-- Here's where the ball gets =

  =
  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=20
  267 to 300 =
do<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=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?</DIV></FONT>
  <DIV><FONT face=3DArial =

------=_NextPart_000_0011_01C01344.D40B7B40--

new topic     » goto parent     » topic index » view message » categorize

4. Re: ABGTE2 confusion

------=_NextPart_000_000D_01C01388.87D90280
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Thanks for explaining CK. I was going to, but you did a good job =
explaining it so I won't

I admit in retrospect that documentation should have been typed in =
describing what that demo did. It is one of the largest demos in the =
tutorial.

Thanks

David

  ----- Original Message -----=20
  From: ck lester=20
  To: EUPHORIA at LISTSERV.MUOHIO.EDU=20
  Sent: Thursday, August 31, 2000 1:13 PM
  Subject: Re: ABGTE2 confusion


  Some quickie responses:
         for iy =3D 234 to 266 do            --What is iy and ix? They =
haven't been declared.*

    Loop counters don't have to be declared...

              for ix =3D 200 to 300 do
                   if get_pixel({ix, iy}) =3D 5 then    --*
                        pixel(15,{ix, iy})                --*  <-- =
Here's where the ball gets drawn
                      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?

------=_NextPart_000_000D_01C01388.87D90280
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Thanks for explaining CK. I was going =
to, but you=20
did a good job explaining it so I won't</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I admit in retrospect that =
documentation should=20
have been typed in describing what that demo did. It is one of the =
largest demos=20
in the tutorial.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>David</FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A title=3Dcklester at YAHOO.COM href=3D"mailto:cklester at YAHOO.COM">ck =
lester</A>=20
  </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
title=3DEUPHORIA at LISTSERV.MUOHIO.EDU=20
  =
</A>=20
  </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Thursday, August 31, 2000 =
1:13=20
  PM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Re: ABGTE2 =
confusion</DIV>
  <DIV><BR></DIV>
  <DIV><FONT size=3D2>Some quickie responses:</FONT></DIV>
  <BLOCKQUOTE=20
  style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
    <DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp; for iy =3D =
234 to 266=20
    do&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; --What is =
iy and=20
    ix?&nbsp;They haven't been declared.*</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
    <DIV><FONT size=3D2><STRONG>Loop counters don't have to be=20
    declared...</STRONG></FONT></DIV>
    <DIV><FONT face=3DArial=20
    size=3D2><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
for ix =3D=20
    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; --*&nbsp; <STRONG>&lt;-- Here's where the ball =
gets=20
    =
    end if<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end =

    for<BR>&nbsp;&nbsp;&nbsp;&nbsp; end for<BR>&nbsp;&nbsp;&nbsp;&nbsp; =
for iy =3D=20
    267 to 300 =
do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for=20
    ix =3D 200 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 =

    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; =

    &nbsp;&nbsp;&nbsp; -- Where was it that the picture of ball was=20
    created?</DIV></FONT>
    <DIV><FONT face=3DArial=20

------=_NextPart_000_000D_01C01388.87D90280--

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu