Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Transformation help!

I need this transformed into MIPS Assembly can anyone help?

[code]#include
int n;
int row[8], s = 0;
bool safe(int x, int y)
{
int i;
for (i = 1; i <= y; i++)
if (row[y - i] == x || row[y - i] == x - i || row[y - i] == x + i) return false;

return true;

}
void putboard()
{

printf("
Solution #%d:
---------------------------------
", ++s);
int x,y;
for (y = 0; y < 8; printf("|
---------------------------------
"), y++)
for (x = 0; x < 8; printf(x++ == row[y] ? "| Q " : "| "));

}
int main(int y)
{

int x;
for (x = 0; x < 8; x++)
if (safe(row[y - 1] = x, y - 1))
if (y < 8) main(y + 1);
else putboard();

return 0;
}
[/code]
Sign In or Register to comment.