Advertisement
Mysoft

Untitled

Dec 12th, 2016
640
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. type ItemStruct
  3.   iVisible as integer
  4.   pzName as zstring ptr  
  5. end type
  6.  
  7. dim aItem(7) as ItemStruct = { _
  8. (1,@"a banana") , (0,@"a flower"), (1,@"a bullet"), (0,@"a cape"), _
  9. (1,@"a tuxedo") , (0,@"an wristband"), (1,@"a soda"), (0,@"a marble") }
  10.  
  11. dim as integer uLast(1), uCount=0
  12.  
  13. print "you see ";
  14. for N as integer = 0 to 7
  15.   if aItem(N).iVisible then
  16.     if uCount > 1 then
  17.       print *aItem(uLast(0)).pzName+", ";
  18.       uLast(0) = uLast(1): uLast(1) = N
  19.     else
  20.       uLast(uCount) = N: uCount += 1
  21.     end if
  22.   end if
  23. next N
  24. if uCount = 0 then
  25.   print "nothing."
  26. else
  27.   print *aItem(uLast(0)).pzName;
  28.   if uCount > 1 then
  29.     print " and "+*aItem(uLast(1)).pzName
  30.   end if
  31. end if
  32.  
  33. sleep
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement