Hi,
Lately, just for fun, iv tried to test how a program could use multiple languages.
So i had a sourcecode from winbasic basic (pc) converted to the BlitzBasic PC.
The game was simple guess the number.
First, i decided to use an array, so i copied each text to the data statements, replacing it from the code with an increasing array number.
Then i wrote the translation to English and to fictional Language, as you can see here:
(Pc BlitzBasic sourcecode)
Graphics 640,480,32,2
;Setup number of text and number of languages available
Read aa,bb
For x=1 To bb
Read L$
Print x+" = "+L$
Next
Dim Language$(aa)
CH=Input("Choose 1-"+(x-1)+" >")
If ch<=0 Or ch>bb Then ch=1
y=0
x=0
;Reads the language data
Repeat
x=x+1
y=y+1: If y>bb Then y=1
Read l$
If l$="*end*" Then Goto O1
If y=ch Then c=c+1 : Language(c)=l$ ; Print c+" = "+l$
Forever
.O1
Cls
Text 18*14,12*14, String("*",17)
Text 18*14,13*14, Language(1)
Text 18*14,14*14, String("*",17)
Text 30*14,18*14, Language(2)
While Not GetKey()
Delay 5
Wend
Cls
Locate 0,0
SeedRnd MilliSecs()
Print
zahl=Input(Language(3)) ; ZAHL
If zahl=<2 Then zahl=Int(Rand(1,100))+2
.o2
Cls
Print
Print Language(4)+ ZAHL+Language(5)
Print
ZUFALL = Int(Rand(1,ZAHL))
If ZUFALL = 0 Then Goto o2
For VERSUCHE = 1 To 10
; Print
RATEN=Input(VERSUCHE+Language(6) )
Print
If RATEN = ZUFALL Then
Print Language(7)+VERSUCHE+Language(
Goto O10
End If
If RATEN < ZUFALL Then Print Language(9)
If RATEN > ZUFALL Then Print Language(10)
Print
Next
Print "GAME OVER"
Print Language(11)+ZUFALL
Goto O10
A$=Input()
Cls
End
.O10
Print ""
Print Language(12)
a$=Input(Language(13))
If a$="E" Or a$="e" Then
End
End If
Goto O1
; number of words (needed to dim the Language() array, number of languages (starting from 1)
Data 14,3
; Names of the Languages, uses the number of languages from above
Data "German","English","Hulkster"
;Text in all languages: Depends on the number of languages
Data "*ZAHLENGENERATOR*","*NUMBERGENERATOR*","* HULK SMASH *"
Data "<Bitte eine Taste drücken>","<Press any key to Continue>","Yo SMASH KEY"
Data "Wie groß soll die Zufallszahl sein :","Enter a number to play with , between 1 and :","Punny little HUMAN enter a number :"
Data "Ich denke mir eine Zahl zwischen 1 und ","Im choosing a number between 1 and ","HULK CHOOSE TO : "
Data " aus.","."," NUMBER"
Data ". Versuch> "," try > "," SMASH NUMBER: >"
Data "Sie haben die gesuchte Zahl mit ","You have guessed the number in ","YOU DID "
Data " Versuchen erraten!"," rounds"," SMASHES"
Data "Die eingegebene zahl ist kleiner als meine !","That number is lower than mine","YOU ARE WEAKER !!"
Data "Die eingegebene zahl ist größer als meine !","That number is higher than mine","YOU ARE STRONGER ? IMPOSSIBILE!"
Data "Die gesuchte Zahl war ","I was looking for: ","HULK HAS CHOOSEN: "
Data "Return = nochmal","Return = Play again","SMASH RETURN TO PLAY AGAIN"
Data "E + Return beendet dieses Spiel.> ","E + Return to Quit.> ","SMASH E TO END "
Data "*end*","*end*"
The language definition could be loaded from a text file into the array.
I hope it can help you further.