Skip to main content
gamedev.net
🔒 Locked

Weird <- operator

Started by CRAZY COCONUT COW 5 replies 550+ views
Original Post
CRAZY COCONUT COW
CRAZY COCONUT COW
I was reading this article http://ai-depot.com/LogicGames/MiniMax.html and I see this MinMove (GamePosition game) { best_move <- {}; moves <- GenerateMoves(game); ForEach moves { move <- MaxMove(ApplyMove(game)); if (Value(move) > Value(best_move)) { best_move <- move; } } What is that crazy <- operator? A result of overloading?
MoooooooooooMoooooooooooooooooooMoooooooooooooooooooooooooooooooooo
CRAZY COCONUT COW
CRAZY COCONUT COW
Live long be happy

Mooooooooooo
Mooooooooooooooooooo
Moooooooooooooooooooooooooooooooooo
MoooooooooooMoooooooooooooooooooMoooooooooooooooooooooooooooooooooo
Sneftel
Sneftel
Yeh, that looks like it''s just pseudocode. In pseudocode, you often see a left-facing arrow used for assignment, in order to disambiguate the equality operator.


"Sneftel is correct, if rather vulgar." --Flarelocke
CRAZY COCONUT COW
CRAZY COCONUT COW
Thanks

Mooooooooooo
Mooooooooooooooooooo
Moooooooooooooooooooooooooooooooooo
MoooooooooooMoooooooooooooooooooMoooooooooooooooooooooooooooooooooo
RuneLancer
RuneLancer
quote:
Original post by Sneftel
Yeh, that looks like it''s just pseudocode. In pseudocode, you often see a left-facing arrow used for assignment, in order to disambiguate the equality operator.


"Sneftel is correct, if rather vulgar." --Flarelocke


I was gonna say, that''s "less-than-minus", but then I realized such a thing doesn''t exist.
Sneftel
Sneftel
sure it does. In fact, this is valid (if meaningless) C++ code:

int main()
{
int i;
i <- 3;
}

What happens: the compiler treats the - as unary negation, sees whether the uninitialized variable i is less than negative three, and immediately discards the result. Useless, but interesting.


"Sneftel is correct, if rather vulgar." --Flarelocke

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.