Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/Mad-Libs/FreeBASIC/mad-libs.basic
Normal file
17
Task/Mad-Libs/FreeBASIC/mad-libs.basic
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
Dim As String con, cadena
|
||||
cadena = "<name> went for a walk in the park. <he or she> found a <noun>. <name> decided to take it home."
|
||||
Dim As Integer k = Instr(cadena, "<")
|
||||
|
||||
Print "La historia: "
|
||||
Print cadena & Chr(10)
|
||||
While k
|
||||
Dim As String reemplaza = Mid(cadena, k, Instr(cadena, ">") - k + 1)
|
||||
Print "What should replace "; reemplaza; : Input con
|
||||
While k
|
||||
cadena = Left(cadena, k-1) & con & Mid(cadena, k + Len(reemplaza))
|
||||
k = Instr(k, cadena, reemplaza)
|
||||
Wend
|
||||
k = Instr(cadena, "<")
|
||||
Wend
|
||||
Print Chr(10) & "La historia final: "
|
||||
Print cadena & Chr(10)
|
||||
Loading…
Add table
Add a link
Reference in a new issue