mIRC Home    About    Download    Register    News    Help

Print Thread
#59913 11/11/03 10:27 PM
Joined: Nov 2003
Posts: 4
M
Self-satisified door
OP Offline
Self-satisified door
M
Joined: Nov 2003
Posts: 4
be able to create matrix like var %test[10][10]


/*** Only evils lives here crazy ***/
#59914 11/11/03 10:57 PM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
It's already possible. Here's an example alias that creates a matrix and then runs through it (just type /matrix):
Code:
alias matrix {
  var %i = 1, %j
  ; filling the matrix
  while %i < 11 {
    %j = 1
    while %j < 11 {
      set [color:green]$+(%,matrix[,%i,][,%j,])[/color] Item %i %j
      inc %j
    }
    inc %i
  }
  ; running through the matrix and /echo-ing the items
  %i = 1
  while %i < 11 {
    %j = 1
    while %j < 11 {
      echo -s [color:blue]$eval([/color][color:green]$+(%,matrix[,%i,][,%j,])[/color][color:blue],2)[/color]
      inc %j
    }
    inc %i
  }
  ; cleaning up and finishing
  unset %matrix*
  echo -sc info /matrix finished
}


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#59915 12/11/03 02:03 PM
Joined: Sep 2003
Posts: 584
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Sep 2003
Posts: 584
may i ask what it is for? i saw just a bunch of

Item xx xx

where xx is number...

#59916 12/11/03 04:21 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
When you get more into math, you'll appreciate matrixes. Array's consist solely around the concept of a matrix >:D


-KingTomato
#59917 13/11/03 07:35 AM
Joined: Feb 2003
Posts: 309
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Feb 2003
Posts: 309
I really wish mirc had a better way of structuring data than this hack or the version w/ hash tables.

I find myself constantly needing to model data like XML parsed documents; or database recordsets. Yes, I know mirc isn't meant to be doing ANY of these things; but its far nicer than TCL + Eggdrop; which is aimed more at those things.

Still; I spose we can prevail.



Link Copied to Clipboard