Jump to content

RCRPG/uBasic-4tH: Difference between revisions

Some minor cleanups in the code - spelling, long lines, etc.
(Added uBasic/4tH version)
 
(Some minor cleanups in the code - spelling, long lines, etc.)
Line 34:
 
== The code ==
<lang>Dim @r(216) ' these are our rooms
<lang>
Dim @r(216) ' these are our rooms
 
i = Rnd(36) ' now place the person in a room, floor 0
Line 93 ⟶ 92:
Print : Print
 
Print "Things of interest here:" ' list anything of interest
 
b@ = And(@r(a@)/65536, 255) ' calculate pieces of gold
c@ = And(@r(a@)/256, 255) ' calculate sledges
 
If b@ Then Print "\t";b@;" piece(s) of gold"
Line 103 ⟶ 102:
If @r(a@)/128 = 0 Then Print "\tNothing"
 
If And(@r(a@), 64) Then ' see if we are in the prize room
Print
Print "You found the Prize Room!"
Line 118 ⟶ 117:
While Len(c) ' any string left?
While Peek(c, 0) = Ord(" ") ' is it a space?
c = Chop(c, 1) ' split off space
Next
 
Line 163 ⟶ 162:
Proc _TakeAll ' be greedy
Else Print "Hey, just what you see, pal!\n"
EndIf EndIf EndIf EndIf ' no sauchsuch thing
Return
 
Line 207 ⟶ 206:
EndIf
 
i = ((i/16777216) * 16777216) +Push ((And(i/65536, 255) + And(@r(a@)/65526, 255)) * 65536) + ((And(i/256, 255) + And(@r(a@)/256, 255)) * 256) + a@
Push ((And(i/256, 255) + And(@r(a@)/256, 255)) * 256)
i = ((i/16777216) * 16777216) + Pop() + Pop() + a@
@r(a@) = And(@r(a@), 63)
Else
Line 222 ⟶ 223:
 
If Comp(a@, "sledge") = 0 Then
Proc _EquipSledge ' equip the sledge
Else If Comp(a@, "ladder") = 0 Then
Proc _EquipLadder ' equip the ladder
Else Print "You can't equip that.\n"
EndIf EndIf ' no such thing
Return
 
Line 265 ⟶ 266:
Proc _DropAll ' be greedy
Else Print "You can't drop what you don't have.\n"
EndIf EndIf EndIf EndIf ' no sauchsuch thing
Return
 
Line 314 ⟶ 315:
EndIf
 
@r(a@) =Push ((@r(a@)/65536 + And(i/65536, 255)) * 65536) + ((And(@r(a@)/256, 255) + And(i/256, 255)) * 256) + And(@r(a@), 255)
Push ((And(@r(a@)/256, 255) + And(i/256, 255)) * 256)
@r(a@) = Pop() + Pop() + And(@r(a@), 255)
i = And(i, 255)
Else
Line 379 ⟶ 382:
Print
Print "take (all|item name)"
Print "\t TaketTake the item specified. Or take everything in the room."
Print
Print "inventory"
Line 505 ⟶ 508:
Print "Equip the sledge first. If you got one..\n"
EndIf
Return</lang>
</lang>
374

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.