1. ABGTE2 confusion
- Posted by Paul Kerslake <paulk at UNISERVE.COM> Aug 31, 2000
- 587 views
------=_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> </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, --Does=20 this determine where the ball=20 .125, =20 --=20 R>if=20 graphics_mode(18) then<BR> puts(1, "Mode Set=20 Failure")<BR>else<BR> =20 clear_screen()<BR> ellipse(5, 1, {200,200},=20 {300,300})<BR> for iy =3D 234 to 266 = do =20 --What is iy and ix? They = haven't=20 been = declared.*<BR> for = ix=20 =3D 200 to 300=20 nbsp; =20 if get_pixel({ix, iy}) =3D 5 then =20 pixel(15,{ix, iy}) = =20 =20 =20 end if<BR> end=20 for<BR> end for<BR> for = iy =3D 267=20 to 300 do<BR> for = ix =3D 200=20 to 300=20 nbsp; =20 if get_pixel({ix, iy}) =3D 5=20 pixel(9,{ix,=20 ; =20 end if<BR> end=20 for<BR> end for<BR> ball = =3D=20 save_image({193,193},{308,308}) =20 -- Where was it that the picture of ball was=20 created?<BR> = clear_screen()<BR> =20 position(1,1)<BR> puts(1, "Press q to end this = bouncing=20 ball demo!")<BR> while 1 =3D 1=20 do<BR> if = get_key() =3D 'q'=20 ; =20 exit<BR> end=20 if<BR> for ix =3D = 1 to=20 length(bounce)=20 nbsp; =20 sp; =20 end for<BR> for ix = =3D=20 length(bounce) to 1 by -1=20 nbsp; =20 sp; =20 end for<BR> end = while<BR> if=20 graphics_mode(-1) = puts(1, "Mode Set Failure")<BR> end if<BR>end=20 if<BR></FONT></DIV> <DIV><FONT face=3DArial size=3D2>Thanks for your help. = </FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> ------=_NextPart_000_0007_01C01329.4CFE6060--
2. Re: ABGTE2 confusion
- Posted by Bernie <xotron at PCOM.NET> Aug 31, 2000
- 570 views
-- --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
3. Re: ABGTE2 confusion
- Posted by ck lester <cklester at YAHOO.COM> Aug 31, 2000
- 624 views
------=_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> for iy =3D = 234 to 266=20 do --What is = iy and=20 ix? They haven't been declared.*</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </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> = for ix =3D 200=20 to 300=20 = nbsp; =20 if get_pixel({ix, iy}) =3D 5 then =20 = pixel(15,{ix, iy}) = =20 --* <STRONG><-- Here's where the ball gets = = end if<BR> end=20 for<BR> end for<BR> = for iy =3D=20 267 to 300 = do<BR> for ix=20 =3D 200 to 300=20 = nbsp; =20 if get_pixel({ix, iy}) =3D 5=20 = pixel(9,{ix,=20 = ; =20 end if<BR> end=20 for<BR> end for<BR> = ball =3D=20 save_image({193,193},{308,308}) =20 -- Where was it that the picture of ball was=20 created?</DIV></FONT> <DIV><FONT face=3DArial = ------=_NextPart_000_0011_01C01344.D40B7B40--
4. Re: ABGTE2 confusion
- Posted by David Alan Gay <moggie at INTERLOG.COM> Aug 31, 2000
- 552 views
- Last edited Sep 01, 2000
------=_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> </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> </DIV> <DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>David</FONT></DIV> <DIV> </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> for iy =3D = 234 to 266=20 do --What is = iy and=20 ix? They haven't been declared.*</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </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> = for ix =3D=20 200 to 300=20 = nbsp; =20 if get_pixel({ix, iy}) =3D 5 then =20 = pixel(15,{ix, iy}) = =20 --* <STRONG><-- Here's where the ball = gets=20 = end if<BR> end = for<BR> end for<BR> = for iy =3D=20 267 to 300 = do<BR> for=20 ix =3D 200 to 300=20 = nbsp; =20 if get_pixel({ix, iy}) =3D 5=20 = pixel(9,{ix,=20 = ; =20 end if<BR> end = for<BR> end for<BR> = ball =3D=20 save_image({193,193},{308,308}) = -- Where was it that the picture of ball was=20 created?</DIV></FONT> <DIV><FONT face=3DArial=20 ------=_NextPart_000_000D_01C01388.87D90280--