I have a project I am working on for myself and wondering if someone could help me write it in vb.net...here it is:
Assume we are writing a simple car race program.
In a race, the LeaderBoard tracks the current order of the cars, who
is in first place, etc. I have 10 Cars in the race and we want to know
what order the cars are in. So we will periodically call UpdateLeaderBoard.
Assume that we have a record or a structure, Car, in pseudo-code:
Car
Name: String;
StartPos: Int;
CurPos: Int;
Speed: Int;
end;
You can make it into an object if you want.
Assume for now that the track is straight. I don't have to take
laps into account. I am only concerned with distance from some
0 point. To make it interesting, not all the cars start at the same point.
Position, here, refers to location on the track, not ranking on
the LeaderBoard.
Assume that we can initialize the cars by reading data in from a
file.
Something like
proc InitCars
begin
I = 0;
while I < 10 do
begin
ReadXML(Cars);
Next(I)
end
end
You can rework that however you want, and you can delegate the
details of reading the file if you want.
The routine that calculates the leaders should be called several
times throughout the race to find the current ranking.
I'm especially interested in
the details of UpdateLeaderBoard and how it is called.
I also am interested in unit tests or fitnesse tests with the project.
Or how to test it
Assume we are writing a simple car race program.
In a race, the LeaderBoard tracks the current order of the cars, who
is in first place, etc. I have 10 Cars in the race and we want to know
what order the cars are in. So we will periodically call UpdateLeaderBoard.
Assume that we have a record or a structure, Car, in pseudo-code:
Car
Name: String;
StartPos: Int;
CurPos: Int;
Speed: Int;
end;
You can make it into an object if you want.
Assume for now that the track is straight. I don't have to take
laps into account. I am only concerned with distance from some
0 point. To make it interesting, not all the cars start at the same point.
Position, here, refers to location on the track, not ranking on
the LeaderBoard.
Assume that we can initialize the cars by reading data in from a
file.
Something like
proc InitCars
begin
I = 0;
while I < 10 do
begin
ReadXML(Cars);
Next(I)
end
end
You can rework that however you want, and you can delegate the
details of reading the file if you want.
The routine that calculates the leaders should be called several
times throughout the race to find the current ranking.
I'm especially interested in
the details of UpdateLeaderBoard and how it is called.
I also am interested in unit tests or fitnesse tests with the project.
Or how to test it