|
|
|
|
| Transform 2D array mxn to nxm |
Submitted by Garri Ogata, in8software
//Method: Core_2DArray_Transform(p2DArraySource;p2DArrayDestination; // {nSourceStartColumn;nSourceStartRow}) //Description: This method transforms source (CxR) to destination (RxC) // starting from the sources Column and Starting Row. The destination array // must come in properly sized.
// EX Source (2x3) Destination (3x2) // src a d dst a b c // b e d e f // c f
C_POINTER($1;$2;$p2DaSource;$p2DaDestination) C_LONGINT($3;$4;$nSourceStartColumn;$nSourceStartRow;$nDestinationColumns;$nDestinationRows) C_LONGINT($nNumberOfParameters;$nColumn;$nRow)
$p2DaSource:=$1 $p2DaDestination:=$2
$nSourceStartColumn:=1 $nSourceStartRow:=1
$nNumberOfParameters:=Count parameters
If($nNumberOfParameters>2) $nSourceStartColumn:=$3 $nSourceStartRow:=$4 end if
$nDestinationColumns:=Size of array($p2DaDestination->) $nDestinationRows:=Size of array($p2DaDestination->{1})
For ($nColumn;1;$nDestinationColumns) For ($nRow;1;$nDestinationRows) $p2DaDestination->{$nColumn}{$nRow}:=$p2DaSource->{$nSourceStartColumn}{$nSourceStartRow} $nSourceStartColumn:=$nSourceStartColumn+1 //Go to the next column End for
$nSourceStartColumn:=$nSourceStartColumn-$nDestinationRows //Reset the source start column to its original setting $nSourceStartRow:=$nSourceStartRow+1 //Go to the next row End for |
|
Submit a Tip Archive  |
|
|
 |
|
|
|
| Fifa World Cup |
The 2010 FIFA World Cup is the 19th FIFA World Cup, the premier international association football tournament. It is being held in South Africa, beginning on 11 June and scheduled to conclude on 11 July 2010. The tournament is the culmination of a qualification process that began in August 2007 and involved 204 of the 208 FIFA national teams. As such, it matches the 2008 Summer Olympics as the sports event with the most competing nations. |
|
Suggest a Spotlight
|
|
|
 |
|
|
|
This weekend, we asked you...
|
| Who is going to win the Fifa World Cup (update)? |
|
Your vote: (no vote)
Total votes received: 140
Survey submitted by Gregorio Diaz
|
|
Suggest a Survey
|
|
|
 |
|