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