🎃Spoopy Dami🎃
🎃Spoopy Dami🎃
CC#
Created by 🎃Spoopy Dami🎃 on 5/10/2023 in #help
❔ How would I implement a toroidal universe?
We should probably do this tomorrow im sorrg im super tired
24 replies
CC#
Created by 🎃Spoopy Dami🎃 on 5/10/2023 in #help
❔ How would I implement a toroidal universe?
I did not get this figured out no. Im genuinely so confused
24 replies
CC#
Created by 🎃Spoopy Dami🎃 on 5/10/2023 in #help
❔ How would I implement a toroidal universe?
Like since January. I have had a lot more projects lol. Ill close this then. Thank you!
24 replies
CC#
Created by 🎃Spoopy Dami🎃 on 5/10/2023 in #help
❔ How would I implement a toroidal universe?
I genuinely didnt notice its been so long since i opened this project
24 replies
CC#
Created by 🎃Spoopy Dami🎃 on 5/10/2023 in #help
❔ How would I implement a toroidal universe?
Im.. oh wow
24 replies
CC#
Created by 🎃Spoopy Dami🎃 on 5/10/2023 in #help
❔ How would I implement a toroidal universe?
thats the finite universe.. thats how i implemented the math there.. now i am so unsure how to do the toroidal
24 replies
CC#
Created by 🎃Spoopy Dami🎃 on 5/10/2023 in #help
❔ How would I implement a toroidal universe?
int MainWindow::NeighborCount(int row, int column)
{
int total = 0;

if (_isFinite)
{
if (row - 1 >= 0)
{
if (gameBoard[row - 1][column])
{
total++;
}
if (column - 1 >= 0)
{
if (gameBoard[row - 1][column - 1])
{
total++;
}
}
if (column + 1 < settings.defaultGridSize)
{
if (gameBoard[row - 1][column + 1])
{
total++;
}
}
}

if (row + 1 < settings.defaultGridSize)
{
if (gameBoard[row + 1][column])
{
total++;
}
if (column + 1 < settings.defaultGridSize)
{
if (gameBoard[row + 1][column + 1])
{
total++;
}
}
if (column - 1 >= 0)
{
if (gameBoard[row + 1][column - 1])
{
total++;
}
}

}

if (column + 1 < settings.defaultGridSize)
{
if (gameBoard[row][column + 1])
{
total++;
}

}

if (column - 1 >= 0)
{
if (gameBoard[row][column - 1])
{
total++;
}
}
}
int MainWindow::NeighborCount(int row, int column)
{
int total = 0;

if (_isFinite)
{
if (row - 1 >= 0)
{
if (gameBoard[row - 1][column])
{
total++;
}
if (column - 1 >= 0)
{
if (gameBoard[row - 1][column - 1])
{
total++;
}
}
if (column + 1 < settings.defaultGridSize)
{
if (gameBoard[row - 1][column + 1])
{
total++;
}
}
}

if (row + 1 < settings.defaultGridSize)
{
if (gameBoard[row + 1][column])
{
total++;
}
if (column + 1 < settings.defaultGridSize)
{
if (gameBoard[row + 1][column + 1])
{
total++;
}
}
if (column - 1 >= 0)
{
if (gameBoard[row + 1][column - 1])
{
total++;
}
}

}

if (column + 1 < settings.defaultGridSize)
{
if (gameBoard[row][column + 1])
{
total++;
}

}

if (column - 1 >= 0)
{
if (gameBoard[row][column - 1])
{
total++;
}
}
}
24 replies
CC#
Created by 🎃Spoopy Dami🎃 on 5/10/2023 in #help
❔ How would I implement a toroidal universe?
would you like to see my code for the finite portion of the game of life?
24 replies
CC#
Created by 🎃Spoopy Dami🎃 on 5/10/2023 in #help
❔ How would I implement a toroidal universe?
my brain hurts already
24 replies