Re: Bad Loop?
- Posted by Ad Rienks <kwibus at ZONNET.NL> Sep 07, 2000
- 419 views
------=_NextPart_000_0073_01C0188A.799909C0 charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Thomas, I'm not rewriting your whole program but try a procedure, as you say = yourself: ------ tested code --------- include get.e include graphics.e object desc, sentence sentence =3D "The color changing sentence" procedure colortext(object number) number -=3D '0' text_color(number) position(1, 26) puts(1, sentence) end procedure position(1, 26) puts(1, sentence) while 1 do desc =3D wait_key() if desc >=3D '0' and desc <=3D '9' then colortext(desc) elsif desc =3D 'b' then -- try to code a blinky procedure yourself elsif desc =3D 'q' then exit end if end while -------- end tested code -------------- Cheers, Ad ----- Oorspronkelijk bericht -----=20 Van: Paul Kerslake=20 Aan: EUPHORIA at LISTSERV.MUOHIO.EDU=20 Verzonden: donderdag 7 september 2000 4:05 Onderwerp: Bad Loop? I've included a file which I think has a bad loop in it. The way I see = it is that there should be about 1/3 as many lines. There is SO much = repition you wouldn't believe it. So, please check it out and send me = back a solution or an updated file. -Thanks -Thomas ------=_NextPart_000_0073_01C0188A.799909C0 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.2314.1000" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV>Thomas,</DIV> <DIV> </DIV> <DIV>I'm not rewriting your whole program but try a procedure, as you = say=20 yourself:</DIV> <DIV> </DIV> <DIV>------ tested code = ---------</DIV> <DIV>include get.e<BR>include graphics.e</DIV> <DIV> </DIV> <DIV>object desc, sentence<BR>sentence =3D "The color changing = sentence"</DIV> <DIV> </DIV> <DIV>procedure colortext(object number)<BR> number = -=3D=20 '0'<BR> text_color(number)<BR> = position(1,=20 26)<BR> puts(1, sentence)<BR>end procedure</DIV> <DIV> </DIV> <DIV>position(1, 26)<BR>puts(1, sentence)</DIV> <DIV> </DIV> <DIV>while 1 do<BR> desc =3D = wait_key()<BR> if=20 desc >=3D '0' and desc <=3D '9'=20 colortext(desc)<BR> elsif desc =3D 'b'=20 then<BR> -- try to code a=20 blinky procedure yourself<BR> elsif desc =3D 'q'=20 then<BR> = exit<BR> =20 end if<BR>end while</DIV> <DIV>-------- end tested code =20 --------------</DIV> <DIV> </DIV> <DIV>Cheers, Ad</DIV> <BLOCKQUOTE=20 style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: = 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"> <DIV style=3D"FONT: 10pt arial">----- Oorspronkelijk bericht ----- = </DIV> <DIV=20 style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: = black"><B>Van:</B>=20 <A href=3D"mailto:paulk at UNISERVE.COM" title=3Dpaulk at UNISERVE.COM>Paul = Kerslake</A>=20 </DIV> <DIV style=3D"FONT: 10pt arial"><B>Aan:</B> <A=20 href=3D"mailto:EUPHORIA at LISTSERV.MUOHIO.EDU"=20 title=3DEUPHORIA at LISTSERV.MUOHIO.EDU>EUPHORIA at LISTSERV.MUOHIO.EDU</A> = </DIV> <DIV style=3D"FONT: 10pt arial"><B>Verzonden:</B> donderdag 7 = september 2000=20 4:05</DIV> <DIV style=3D"FONT: 10pt arial"><B>Onderwerp:</B> Bad Loop?</DIV> <DIV><BR></DIV> <DIV><FONT face=3DArial size=3D2>I've included a file which I think = has a bad loop=20 in it. The way I see it is that there should be about 1/3 as many = lines. There=20 is SO much repition you wouldn't believe it. So, please check it out = and send=20 me back a solution or an updated file.</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>-Thanks</FONT></DIV> <DIV><FONT face=3DArial = ------=_NextPart_000_0073_01C0188A.799909C0--