languages_and_translators/final_lang/prueba.fort.out

95 lines
1.4 KiB
Text
Raw Normal View History

2019-04-29 17:56:14 -05:00
print 'Choose and option'
print endline
print '1 - Calculate the factorial of a number'
print endline
print '2 - Calculate a number to the power of another number'
print endline
print '3 - Calculate e to the power of a number'
print endline
read $50
== $50 1 $0
gotoF $0 28
print 'Enter the number'
print endline
read $52
= 1 $51
= 1 $54
<= $54 $52 $0
gotoF $0 24
* $51 $54 $1
= $1 $51
+ $54 1 $1
= $1 $54
goto 17
print 'The result is : '
print $51
print endline
goto 88
== $50 2 $1
gotoF $1 49
print 'Enter the base'
print endline
read $52
print 'Enter the exponent'
print endline
read $53
= 1 $51
= 1 $54
<= $54 $53 $1
gotoF $1 45
* $51 $52 $2
= $2 $51
+ $54 1 $2
= $2 $54
goto 38
print 'The result is : '
print $51
print endline
goto 88
== $50 3 $2
gotoF $2 86
print 'Enter the exponent'
print endline
read $52
= 0 $51
= 0 $54
<= $54 10 $2
gotoF $2 82
= 1 $56
= 1 $55
<= $55 $54 $3
gotoF $3 67
* $56 $55 $4
= $4 $56
+ $55 1 $4
= $4 $55
goto 60
= 1 $57
= 1 $55
<= $55 $54 $4
gotoF $4 76
* $57 $52 $5
= $5 $57
+ $55 1 $5
= $5 $55
goto 69
/ $57 $56 $5
+ $51 $5 $6
= $6 $51
+ $54 1 $6
= $6 $54
goto 56
print 'The result is : '
print $51
print endline
goto 88
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 $50
== $50 0 $6
gotoF $6 94
goto 95
goto 1