Trying to preserve the essence of the code.
The program prints the line "Press any key to continue.". The cursor blinks once or twice and then fails. Does not print the "TEST PRINT!!!!"
Freebasic 1.05 (64 bit)
Code: Select all
#Lang "qb"
'Source code has line numbers, so any reference "GoSub 3760" will be "GoSub L3760"
'Yes, I know that line numbers are supported ...
'All comments with a '*' are mine, author's is regular
'* the "KEY OFF" command is no longer used/needed.
Cls ':KEY OFF
Locate 10,1 : X$="The Journey of Marco Polo, 1271" : GoSub L3760
Locate 13,1 : X$="(c) David H. Ahl, 1986" : GoSub L3760
Locate 14,1 : X$="Adapted by bcohio2001, 2017" : GoSub L3760 '* My credit line on screen
Locate 23,1 : GoSub L3720 : Cls
Dim EP(20)
Dim MO$(6) '* Not in source. QBasic, I think, automaticly Dimmed arrays at 10.
JL=300 : C=2 : W=30 : M=5 : FP=5 : BSK=99 'Initial quanities
GoSub L360 : GoSub L3560 'Display scenario
'* old way
'While RN > 32767 : RN -= 65535 : Wend : Randomize RN
Randomize Timer
Sleep
End
L360:
X$="The Journey of Marco Polo, 1271" : GoSub L3760 : Print : Print
Print " Starting from Venice in 1271 you travel by sailing ship to the"
Print "port of Armenia. Upon arrival, you prepare for a 6000 mile trek to"
Print "the court of the Great Kublai Khan in Shag-tu, Cathay. Having set"
Print "aside"; JL; " precious jewels to finance your planned 3 year trip, you"
Print "must barter for the following supplies in Armenia."
Print " * Camels (Sturdier animals will cost more. You will probably"
Print " want 8 to 10 camels to carry your many supplies.)"
Print " * Food (You must barter for food as you travel along. However,"
Print " prices tend to be lower in port cities, so you should pack"
Print " in a good supply at the start."
Print " * Oil for lamps and cooking (Over much of the trip you will be"
Print " able to use wood to build fires. However, in the Persian,"
Print " Lop, and Gobi deserts you will need oil.)"
Print
Print " From Venice you have also packed clothing, weapons (crossbows),"
Print "and medicines (balms and unguents); however, your provisions will be"
Print "depleted as you go along and you must replenish them. The selection"
Print "and price of supplies is quite different in various regions, so you"
Print "must barter wisely. As a merchant, you are not skilled in fishing"
Print "or hunting, although occasionally you might be able to to try to get"
Print "some food in this way."
GoSub L3720 : Print : Return
L3560:
'read events
For I = 1 To 14 : Read A : EPT += A : EP(I) = EPT : Next I
Data 6, 4, 4, 6, 6, 6, 6, 4, 4, 1, 6, 8, 18, 10 'totals 89
For I = 1 To 6 : Read MO$(I) : Next I : Return
Data "March", "May", "July", "September", "November", "January"
L3720:
'hit any key
X$="Press any key to continue." : GoSub L3760
Print "TEST PRINT!!!!"
'While Len(InKey$) = 0 : RN += 1 : Wend : Return
While InKey$ = "" : RN += 1 : Wend : Return
L3760:
'print centered line
'* Source had 70 - ....
Print Tab((80 - Len(X$))\2); X$; : Return