It appears to be a random number generator based on the "Seed". At the top is a function for InitializeComponent(); which isn't anywhere in the body of code. I don't understand fully what it's supposed to do, but can give you some translation ideas. Let's break some of it down. All of the "Using"s listed at the top bring in macros and such from external files that are part of VS. Again, without actually looking each of them up, it's hard to tell what they contribute. The rest of the document is a Collection; more specifically it's called "namespace Calculation"; the rules which are probably spelled out in "System.Collections.Generic;".
"int Func3(int paramInt1, int paramInt2, int paramInt3)" is a subroutine. In PBP we'd use "Func3:", but first we'd have to already declare:
Code:
paramInt1 VAR SIGNED WORD
paramInt2 VAR SIGNED WORD
paramInt3 VAR SIGNED WORD
Then prior to GOSUB Func3 we have to assign values to them:
Code:
paramInt1 = 1234
paramInt2 = -567
paramInt3 = 890
Next:
Code:
int Func3(int paramInt1, int paramInt2, int paramInt3)
{
int i = paramInt1 << 8 | paramInt2;
int j;
int k; int m; int n; int i1; switch (paramInt3)
{
case 65:
case 66:
"switch (paramInt3)" would be the same as "SELECT CASE paramInt3:" Also, " int i = paramInt1 << 8 | paramInt2;" is the same as
i.HIGHBYTE = paramInt1
i.LOWBYTE = paramInt2
At the bottom of the switch routine is "return Func2(i, j, k, m, n, i1);" In PBP we would have already placed the resultant values in each of these variables with
Code:
case 111:
j = 16360;
k = 6010;
m = 0;
n = 1;
i1 = -2;
"int getKey(int i)" manipulates the input ("i") with masks. I forget the hierarchy as to which gets precedence; ">>" or "&", and without parentheses, I would have to look it up to know for sure which operation is executed first.
I know this isn't everything, but hopefully it will help you to work through much of it. Do what you can then report back where you're having challenges.
Bookmarks