Potato_Boy🦉
Homework Help . How to make a route to find the most amount of coins in a certain amount of moves ?
N is the size of the grid and P is the amount of coins . coinvar is for the list so that its adds all the coins to the list but i am not sure if its the correct methode . and the coins are represent with their xy coordinates like 1,0 for exemple where x is 1 then there is a , and then we have y is 0 .
29 replies
Homework Help . How to make a route to find the most amount of coins in a certain amount of moves ?
that's all of the code i have for now all the data is
N = Int32.Parse(data[0]);
string[] coord = data[1].Split(',');
X = Int32.Parse(coord[0]);
Y = Int32.Parse(coord[1]);
D = Int32.Parse(data[2]);
P = Int32.Parse(data[3]);
int Coinvar = 4;
var Coins = new List<string>();
int c = 0;
for (c=0;c<P;++c)
{
Coins.Add(data[Coinvar]);
Coinvar += 1;
29 replies
Homework Help . How to make a route to find the most amount of coins in a certain amount of moves ?
okay so he know's about all the coins but if they are two or more coins near him he uses the magic compass to decide which one he should go after
the magic compass scan the areas and counts the coins that are in each direction and the direction where there are the most coins is where the hero will move too .
basically the work is that i have a txt file with all the settings and moves and in the end the results must be the same
29 replies