bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnubg] GNUBG / GNU Coding Standards - C and or C++ - feedback w


From: Øystein Schønning-Johansen
Subject: Re: [Bug-gnubg] GNUBG / GNU Coding Standards - C and or C++ - feedback wanted
Date: Fri, 14 Feb 2014 14:36:28 +0100

Let me make up the same program snippet with C++ syntax:

Board board = Board();
Evaluator* eval = new gnubg();
Dice roll = Dice( 3, 1);
Move best = eval->find_best_move( &board, &roll );

std::cout << "Best move is: " << best;

// I just made up this code based on the abstractions I listed in the paragraph above. Note the syntax is C++.
// The code is not tested or compiled ... And my C++ is a bit rusty, so there probably bad errors.

If I just had my head, I would know how to instantiate a C++ object on the stack. :-) Here comes the "patch":

Board board();
Evaluator* eval = new Gnubg();
Dice roll( 3, 1 );
Move best = eval->find_bet_move( &board, &roll );

-Øystein :-)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]