rogin
New Member
Posts: 2
|
Post by rogin on Aug 12, 2011 20:28:01 GMT -5
Hello! I like Brutus2d, but there is no operator "GOTO". Give me as I write this program in the Brutus: 10 INPUT "A, B="; a1, b1 100 a=ABS(a1): b=ABS(b1): r=1: s=1 110 IF a=0 OR b=0 THEN r1=ABS(a+b): GOTO 1000 120 IF 2*INT(a/2)<>a THEN 140 130 a=a/2: r=r*2: GOTO 120 140 IF 2*INT(b/2)<>b THEN 160 150 b=b/2: s=s*2: GOTO 140 160 k=s: IF k>r THEN k=r 170 IF a=b THEN 220 180 IF a>b THEN a=a-b: GOTO 200 190 b=b-a: r1=b: b=a: a=r1 200 a=a/2: IF 2*INT(a/2)=a THEN 200 210 GOTO 170 220 r1=a*k 1000 PRINT "R1=", r1 1010 END
|
|
|
Post by matthew on Aug 13, 2011 21:09:52 GMT -5
Well most of those Goto Statements could be removed by using Loops. Look in the Help Guide for Using Loops to Repeat Code.
|
|
rogin
New Member
Posts: 2
|
Post by rogin on Aug 16, 2011 3:28:05 GMT -5
Thank you!
|
|