languages_and_translators/final_lang/prueba.fort.out

96 lines
1.4 KiB
Text
Raw Normal View History

2019-04-30 09:54:10 -05:00
goto 2
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
2019-04-30 09:54:10 -05:00
gotoF $0 29
2019-04-29 17:56:14 -05:00
print 'Enter the number'
print endline
read $52
= 1 $51
= 1 $54
<= $54 $52 $0
2019-04-30 09:54:10 -05:00
gotoF $0 25
2019-04-29 17:56:14 -05:00
* $51 $54 $1
= $1 $51
+ $54 1 $1
= $1 $54
2019-04-30 09:54:10 -05:00
goto 18
2019-04-29 17:56:14 -05:00
print 'The result is : '
print $51
print endline
2019-04-30 09:54:10 -05:00
goto 89
2019-04-29 17:56:14 -05:00
== $50 2 $1
2019-04-30 09:54:10 -05:00
gotoF $1 50
2019-04-29 17:56:14 -05:00
print 'Enter the base'
print endline
read $52
print 'Enter the exponent'
print endline
read $53
= 1 $51
= 1 $54
<= $54 $53 $1
2019-04-30 09:54:10 -05:00
gotoF $1 46
2019-04-29 17:56:14 -05:00
* $51 $52 $2
= $2 $51
+ $54 1 $2
= $2 $54
2019-04-30 09:54:10 -05:00
goto 39
2019-04-29 17:56:14 -05:00
print 'The result is : '
print $51
print endline
2019-04-30 09:54:10 -05:00
goto 89
2019-04-29 17:56:14 -05:00
== $50 3 $2
2019-04-30 09:54:10 -05:00
gotoF $2 87
2019-04-29 17:56:14 -05:00
print 'Enter the exponent'
print endline
read $52
= 0 $51
= 0 $54
<= $54 10 $2
2019-04-30 09:54:10 -05:00
gotoF $2 83
2019-04-29 17:56:14 -05:00
= 1 $56
= 1 $55
<= $55 $54 $3
2019-04-30 09:54:10 -05:00
gotoF $3 68
2019-04-29 17:56:14 -05:00
* $56 $55 $4
= $4 $56
+ $55 1 $4
= $4 $55
2019-04-30 09:54:10 -05:00
goto 61
2019-04-29 17:56:14 -05:00
= 1 $57
= 1 $55
<= $55 $54 $4
2019-04-30 09:54:10 -05:00
gotoF $4 77
2019-04-29 17:56:14 -05:00
* $57 $52 $5
= $5 $57
+ $55 1 $5
= $5 $55
2019-04-30 09:54:10 -05:00
goto 70
2019-04-29 17:56:14 -05:00
/ $57 $56 $5
+ $51 $5 $6
= $6 $51
+ $54 1 $6
= $6 $54
2019-04-30 09:54:10 -05:00
goto 57
2019-04-29 17:56:14 -05:00
print 'The result is : '
print $51
print endline
2019-04-30 09:54:10 -05:00
goto 89
2019-04-29 17:56:14 -05:00
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
2019-04-30 09:54:10 -05:00
gotoF $6 95
goto 96
goto 2