Fixed issue with do statements with counter where artihmetic expressions couldn't be used as conditions only contants or variables, created the program 1
This commit is contained in:
parent
34d4697aa9
commit
c7d211f0b5
9 changed files with 426 additions and 101 deletions
215
final_lang/programa1.fort.out
Normal file
215
final_lang/programa1.fort.out
Normal file
|
|
@ -0,0 +1,215 @@
|
|||
goto 156
|
||||
print 'Enter number of rows: '
|
||||
read $279
|
||||
<= $279 5 $0
|
||||
> $279 0 $1
|
||||
.and. $0 $1 $2
|
||||
gotoF $2 9
|
||||
goto 12
|
||||
print 'number of rows must be greater than 0 and less than 6'
|
||||
print endline
|
||||
goto 2
|
||||
print 'Enter number of columns: '
|
||||
read $278
|
||||
<= $278 5 $2
|
||||
> $278 0 $0
|
||||
.and. $2 $0 $1
|
||||
gotoF $1 19
|
||||
goto 22
|
||||
print 'number of columns must be greater than 0 and less than 6'
|
||||
print endline
|
||||
goto 12
|
||||
goback
|
||||
= 0 $275
|
||||
- $285 1 $2
|
||||
<= $275 $2 $0
|
||||
gotoF $0 47
|
||||
= 0 $276
|
||||
- $282 1 $4
|
||||
<= $276 $4 $5
|
||||
gotoF $5 44
|
||||
print 'Enter value ('
|
||||
print $275
|
||||
print ','
|
||||
print $276
|
||||
print ') for matrix 1'
|
||||
print endline
|
||||
* $275 5 $6
|
||||
+ $276 $6 $6
|
||||
+ 200 $6 $6
|
||||
read *6
|
||||
+ $276 1 $7
|
||||
= $7 $276
|
||||
goto 29
|
||||
+ $275 1 $7
|
||||
= $7 $275
|
||||
goto 25
|
||||
goback
|
||||
= 0 $275
|
||||
- $286 1 $8
|
||||
<= $275 $8 $9
|
||||
gotoF $9 72
|
||||
= 0 $276
|
||||
- $283 1 $11
|
||||
<= $276 $11 $12
|
||||
gotoF $12 69
|
||||
print 'Enter value ('
|
||||
print $275
|
||||
print ','
|
||||
print $276
|
||||
print ') for matrix 2'
|
||||
print endline
|
||||
* $275 5 $13
|
||||
+ $276 $13 $13
|
||||
+ 225 $13 $13
|
||||
read *13
|
||||
+ $276 1 $14
|
||||
= $14 $276
|
||||
goto 54
|
||||
+ $275 1 $14
|
||||
= $14 $275
|
||||
goto 50
|
||||
goback
|
||||
= 0 $275
|
||||
- $285 1 $15
|
||||
<= $275 $15 $16
|
||||
gotoF $16 98
|
||||
= 0 $276
|
||||
- $282 1 $18
|
||||
<= $276 $18 $19
|
||||
gotoF $19 95
|
||||
* $275 5 $20
|
||||
+ $276 $20 $20
|
||||
+ 250 $20 $20
|
||||
* $275 5 $21
|
||||
+ $276 $21 $21
|
||||
+ 200 $21 $21
|
||||
* $275 5 $22
|
||||
+ $276 $22 $22
|
||||
+ 225 $22 $22
|
||||
+ *21 *22 $23
|
||||
= $23 *20
|
||||
+ $276 1 $20
|
||||
= $20 $276
|
||||
goto 79
|
||||
+ $275 1 $20
|
||||
= $20 $275
|
||||
goto 75
|
||||
goback
|
||||
= 0 $275
|
||||
- $287 1 $23
|
||||
<= $275 $23 $21
|
||||
gotoF $21 134
|
||||
= 0 $276
|
||||
- $284 1 $24
|
||||
<= $276 $24 $25
|
||||
gotoF $25 131
|
||||
= 0 $280
|
||||
= 0 $277
|
||||
- $282 1 $27
|
||||
<= $277 $27 $28
|
||||
gotoF $28 124
|
||||
* $275 5 $29
|
||||
+ $277 $29 $29
|
||||
+ 200 $29 $29
|
||||
* $277 5 $30
|
||||
+ $276 $30 $30
|
||||
+ 225 $30 $30
|
||||
* *29 *30 $31
|
||||
+ $280 $31 $29
|
||||
= $29 $280
|
||||
+ $277 1 $29
|
||||
= $29 $277
|
||||
goto 110
|
||||
* $275 5 $29
|
||||
+ $276 $29 $29
|
||||
+ 250 $29 $29
|
||||
= $280 *29
|
||||
+ $276 1 $29
|
||||
= $29 $276
|
||||
goto 105
|
||||
+ $275 1 $29
|
||||
= $29 $275
|
||||
goto 101
|
||||
goback
|
||||
= 0 $275
|
||||
- $287 1 $31
|
||||
<= $275 $31 $30
|
||||
gotoF $30 155
|
||||
= 0 $276
|
||||
- $284 1 $33
|
||||
<= $276 $33 $34
|
||||
gotoF $34 151
|
||||
* $275 5 $35
|
||||
+ $276 $35 $35
|
||||
+ 250 $35 $35
|
||||
print *35
|
||||
print ' '
|
||||
+ $276 1 $35
|
||||
= $35 $276
|
||||
goto 141
|
||||
print endline
|
||||
+ $275 1 $35
|
||||
= $35 $275
|
||||
goto 137
|
||||
goback
|
||||
= 1 $280
|
||||
<= $280 2 $35
|
||||
gotoF $35 172
|
||||
print 'Enter dimensions for matrix '
|
||||
print $280
|
||||
print endline
|
||||
call 2
|
||||
- $280 1 $36
|
||||
+ 285 $36 $37
|
||||
= $279 *37
|
||||
- $280 1 $37
|
||||
+ 282 $37 $38
|
||||
= $278 *38
|
||||
+ $280 1 $38
|
||||
= $38 $280
|
||||
goto 157
|
||||
call 23
|
||||
call 48
|
||||
print 'Choose and option'
|
||||
print endline
|
||||
print '1 - Multiply the matrices'
|
||||
print endline
|
||||
print '2 - Sum the matrices'
|
||||
print endline
|
||||
read $281
|
||||
== $281 1 $38
|
||||
gotoF $38 193
|
||||
== $282 $286 $40
|
||||
gotoF $40 190
|
||||
= $285 $287
|
||||
= $283 $284
|
||||
call 99
|
||||
call 135
|
||||
goto 192
|
||||
print 'Sorry cannnot multiply matrices with theses dimensions'
|
||||
print endline
|
||||
goto 209
|
||||
== $281 2 $44
|
||||
gotoF $44 207
|
||||
== $285 $286 $46
|
||||
== $282 $283 $49
|
||||
.and. $46 $49 $50
|
||||
gotoF $50 204
|
||||
= $285 $287
|
||||
= $282 $284
|
||||
call 73
|
||||
call 135
|
||||
goto 206
|
||||
print 'Sorry cannnot sum matrices with theses dimensions'
|
||||
print endline
|
||||
goto 209
|
||||
print 'Not a valid option'
|
||||
print endline
|
||||
print 'Would you like to make another calculation? (type 1 for yes or 0 for no)'
|
||||
print endline
|
||||
read $281
|
||||
== $281 0 $53
|
||||
gotoF $53 215
|
||||
goto 216
|
||||
goto 174
|
||||
Loading…
Add table
Add a link
Reference in a new issue