|
I can try to explain what I trying to
solve.
I have a Robot which can turn left, turn right or moveForward. now I have a string like 'LAR' that means the robot needs to turn left (l) , move forward one place (A) and turn left. and I have to keep track to which direction the robot is facing and on which coordinate it stands. so to summarize with the above string lets say the robot is facing north on coordinate (0,0) then it has to turn left , so its facing east and still on coordinate (0,0) then it has to move forward, so its still facing east but are on coordinate(0,1) then it has to turn right, so its facing north and on coordinate (0,1) and TimMacKinnon has challenged me to do this with double dispatch. So I think now I need a object Direction, a sub object North and a sub - sub object TurnLeft, turnRight and moveForward. So I can use double dispath first the direction North, East, South, West and then use double dispatch to find the right move. Roelof Op 8-4-2019 om 06:50 schreef Richard O'Keefe:
|
- [Pharo-users] difference between double dispatch a... Roelof Wobben
- Re: [Pharo-users] difference between double d... K K Subbu
- Re: [Pharo-users] difference between doub... Roelof Wobben
- Re: [Pharo-users] difference between doub... Roelof Wobben
- Re: [Pharo-users] difference between ... Richard O'Keefe
- Re: [Pharo-users] difference betw... Roelof Wobben
- Re: [Pharo-users] difference... Richard O'Keefe
- Re: [Pharo-users] differ... Roelof Wobben
- Re: [Pharo-users] differ... Roelof Wobben
- Re: [Pharo-users] di... Richard O'Keefe
- Re: [Pharo-users] di... Roelof Wobben
- Re: [Pharo-users] di... Richard O'Keefe
- Re: [Pharo-users] di... Roelof Wobben
- Re: [Pharo-users] di... Richard O'Keefe
- [Pharo-users] [OT] (... Esteban Lorenzano
- Re: [Pharo-users] [O... [email protected]
