Advertisement
gnamp

Domitron Answers 2nd draft

Nov 23rd, 2012
426
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'Domitron answers- by Dominic McGough 23/11/2012
  2.  
  3. start:
  4. GraphicsWindow.Show()
  5. GraphicsWindow.Height = 350
  6. GraphicsWindow.Width = 800
  7. GraphicsWindow.Clear()
  8. GraphicsWindow.DrawText(0,0,"Petition Domitron to get it's attention [eg. Domitron, please answer...]")
  9. GraphicsWindow.DrawText(0,40,"Petition: ")
  10. GraphicsWindow.DrawText(0,60,"Question: ")
  11.  
  12. i = 0
  13. fullstopFlag = 0
  14. returns = 0
  15. faketext = "Domitron, please answer......."
  16.  
  17. 'array loader
  18. For i = 1 To Text.GetLength(faketext)
  19.   pretend[i] = Text.GetSubText(faketext,i,1)
  20. EndFor
  21.  
  22. GraphicsWindow.TextInput = typing
  23.  
  24. sub typing
  25.  
  26.   If returns = 2 Then
  27.     If fullstopFlag = 1 Then
  28.       GraphicsWindow.FontSize = 65
  29.       GraphicsWindow.BrushColor = "red"
  30.       GraphicsWindow.DrawText(100,175,Text.GetSubTextToEnd(secret,2))
  31.       Sound.PlayChime()
  32.       Goto start  
  33.     Else
  34.       GraphicsWindow.FontSize = 20
  35.       GraphicsWindow.BrushColor = "blue"
  36.       GraphicsWindow.DrawText(20,200,"I'm Stumped! Please ask another way.")
  37.       Sound.PlayClick()
  38.     EndIf
  39.   EndIf
  40.  
  41.   If GraphicsWindow.LastText <> Text.GetCharacter(13) then
  42.     linetyped = linetyped + GraphicsWindow.LastText
  43.    
  44.     If Text.StartsWith(linetyped,".") And returns = 0 Then 'if fullstop used 1st
  45.       fullstopFlag = 1
  46.       GraphicsWindow.DrawText(cursoralong + 65,cursordown + 40, pretend[j+1])
  47.       j = j + 1
  48.       cursoralong = cursoralong + 10  
  49.       secret = linetyped
  50.      
  51.     Else 'if fullstop NOT used 1st
  52.       ordtxt = GraphicsWindow.LastText
  53.       GraphicsWindow.DrawText(cursoralong + 65,cursordown + 40,ordtxt)
  54.       cursoralong = cursoralong + 10
  55.     EndIf
  56.    
  57.   else 'if 'return' used
  58.    
  59.     returns = returns + 1
  60.     cursordown = cursordown + 20
  61.     cursoralong = cursoralong - Text.GetLength(linetyped)* 10
  62.     If returns = 2 Then
  63.       GraphicsWindow.DrawText(20,100,"Press the Spacebar to reveal answer!!")
  64.     EndIf
  65.    
  66.   EndIf
  67. endsub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement