Empty Space > Testing

code highlight test

(1/1)

Myst:
testtest


--- Code: (java) ---import java.util.Scanner;
public class Rotator {

/**
* Function that returns an array
* @param int[] args - The array to be rotated
* @param int rotation - number of rotations
* @return array
* */
public static int[] rotate(int args[], int rotation){

int last;
for(int i = 0; i < rotation; i++){
last = args[args.length - 1];
for(int j = args.length-2; j >= 0; j--){
args[j+1] = args[j];
}
args[0] = last;
}
return args;
}

/**
* Demonstration for the program
*
* */
public static void main(String[]args){

Scanner input = new Scanner(System.in);
System.out.print("Enter Rotations: ");

int rotations = input.nextInt();   //get user input for number of rotations
int[]nums = {1,2,3,4,5,6,7,8,9,0};

for(int i : rotate(nums, rotations)){ //Display results after rotation
System.out.println(i);
}
}
}


--- End code ---


--- Code: (vb) ---Public Function ClearedMapData(MapData As String) As String 'Remove < 0x20 chars from sc/bw mapdata

Dim M As Long
M = 1

Do Until M >= Len(MapData)
 
 
If buf2.GetBYTE(Mid$(MapData, M, 1)) < 20 Then

MapData = Replace(MapData, Mid$(MapData, M, 1), "")
End If

M = M + 1


DoEvents
Loop

ClearedMapData = Trim(MapData)

 End Function

--- End code ---


--- Code: (cpp) ---void CryptoSha256::Update(LPVOID lpData, DWORD dwLen){

DWORD i, j, p;
PBYTE pbData = (PBYTE)lpData;

j = (m_Context->count[0] >> 3) & 0x3F;

if ((m_Context->count[0] += dwLen << 3) < (dwLen << 3)){
m_Context->count[1]++;
}

m_Context->count[1] += (dwLen >> 29);

p = 0x40 - j;

if (dwLen >= p) {
memcpy(&m_Context->buffer[j], pbData, p);

Transform(m_Context->state, m_Context->buffer);

for (i = p; i + 0x40 <= dwLen; i += 0x40) {
Transform(m_Context->state, &pbData[i]);
}

j = 0;

}else{
i = 0;
}

memcpy(&m_Context->buffer[j], &pbData[i], dwLen - i);
}

--- End code ---

Navigation

[0] Message Index

It appears that you have not registered with DarkBlizz - Making Battle.net Magic -. To register, please click here...
Go to full version