Faking a 2D array and % symbols on output

  • Krell
  • Krell's Avatar Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
More
7 months 1 week ago #8568 by Krell
Hey all,

I've managed to cobble together a script that fakes a 2-dimensional array. Unformatted and raw from my text editor: (the []'s aren't required, but just a convention I sort of like)
set i 0 
set j 0 
set m 0 
set n 0 

if count == %cmd%
   while %i% <= 5
      set array[%i%][j] %m% 
      while %j% <= 5
         set array[i][%j%] %n% 
         eval n %n% + 1 
         eval j %j% + 1 
      done
      eval m %m% + 1 
      eval i %i% + 1 
      set j 0 
   done

   set i 0 
   set j 0 

   while %i% <= 5 
      while %j% <= 5
         %echo% %%%array[%%i%%][%%j%%]%%%
         eval j %j% + 1 
      done
      eval i %i% + 1 
      set j 0 
   done
else
   return 0
end

Which seems to work except I get %'s in the output which I really don't want.

#LOG: LOGGING OUTPUT TO 'fake2dlist.log' FILESIZE: 0

Jess the test MOB. has arrived.
set krell level 20
Krell's level set to 20.
count

%00%
%01%
%02%
%03%
%04%
%05%
%10%
%11%
%12%
%13%
%14%
%15%
%20%
%21%
%22%
%23%
%24%
%25%
%30%
%31%
%32%
%33%
%34%
%35%
%40%

%41%
%42%
%43%
%44%
%45%
%50%
%51%
%52%
%53%
%54%
%55%

Edgar the test MOB leaves north.
#log off


Is there any way to get rid of them and still get the output I want? I've tried varying the level of %'s on the variable, but it either puts the name of the list or just the names i and j.

Please Log in or Create an account to join the conversation.

More
7 months 1 week ago #8569 by Parnassus
Replied by Parnassus on topic Faking a 2D array and % symbols on output
Please login to view the answers
The following user(s) said Thank You: Krell

Please Log in or Create an account to join the conversation.

  • Krell
  • Krell's Avatar Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
More
7 months 1 week ago #8570 by Krell
Replied by Krell on topic Faking a 2D array and % symbols on output
Please login to view the answers

Please Log in or Create an account to join the conversation.

  • Krell
  • Krell's Avatar Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
More
7 months 1 week ago - 7 months 1 week ago #8571 by Krell
Replied by Krell on topic Faking a 2D array and % symbols on output
Please login to view the answers
Last edit: 7 months 1 week ago by Krell. Reason: Because it's "levels" not "level's"

Please Log in or Create an account to join the conversation.

More
5 months 4 days ago #8647 by Parnassus
Replied by Parnassus on topic Faking a 2D array and % symbols on output
Please login to view the answers

Please Log in or Create an account to join the conversation.

Time to create page: 0.141 seconds