You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* * Prints out a grid of the order with which the Knight moved. */voidprintSteps() {
intstepsAmount=sizeX*sizeY;
intmagnitude=lengthInt(stepsAmount);
charprintfFormat[30] ="%0";
charmagnitudeString[10];
/* * printfFormat = "%0Xd\n" * X is the number of digits that the largest step contains * Used to print out leading 0's so the grid stays aligned */sprintf(magnitudeString, "%d", magnitude);
strcat(printfFormat, magnitudeString);
strcat(printfFormat, "d ");
for(intx=0; x<sizeX; x++) {
for(inty=0; y<sizeY; y++) {
printf(printfFormat, *(steps+y*sizeX+x) +1);
}
printf("\n");
printf("\n");
}
printf("\n");
}
// printSteps - transpiled function from file : king.c , line : 309/* * Prints out a grid of the order with which the Knight moved. *//* * printfFormat = "%0Xd\n" * X is the number of digits that the largest step contains * Used to print out leading 0's so the grid stays aligned */funcprintSteps() {
varstepsAmountint=sizeX*sizeYvarmagnitudeint=lengthInt(stepsAmount)
varprintfFormat []byte= []byte("%0\x00")
varmagnitudeString []byte=make([]byte, 10, 10)
noarch.Sprintf(magnitudeString, []byte("%d\x00"), magnitude)
noarch.Strcat(printfFormat, magnitudeString)
noarch.Strcat(printfFormat, []byte("d \x00"))
{
varxint=0for ; x<sizeX; func() int {
x+=1returnx
}() {
{
varyint=0for ; y<sizeY; func() int {
y+=1returny
}() {
noarch.Printf(printfFormat, steps[(0+y*sizeX+x)]+1)
}
}
noarch.Printf([]byte("\n\x00"))
noarch.Printf([]byte("\n\x00"))
}
}
noarch.Printf([]byte("\n\x00"))
}
Result:
Need for #67
The text was updated successfully, but these errors were encountered: