forked from google-deepmind/open_spiel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make a place for canonical games strings (remove from universal_poker…
… to avoid link errors when ACPC not compiled in) PiperOrigin-RevId: 299208432 Change-Id: Icca0290192e2abdd5058931a595144125a5dd7a1
- Loading branch information
DeepMind Technologies Ltd
authored and
open_spiel@google.com
committed
Mar 5, 2020
1 parent
e5228fe
commit d6d69e2
Showing
6 changed files
with
82 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright 2019 DeepMind Technologies Ltd. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include "open_spiel/canonical_game_strings.h" | ||
|
||
#include <string> | ||
|
||
#include "open_spiel/abseil-cpp/absl/strings/str_format.h" | ||
|
||
namespace open_spiel { | ||
|
||
std::string HunlGameString(const std::string &betting_abstraction) { | ||
return absl::StrFormat( | ||
"universal_poker(betting=nolimit,numPlayers=2,numRounds=4,blind=100 50," | ||
"firstPlayer=2 1 1 " | ||
"1,numSuits=4,numRanks=13,numHoleCards=2,numBoardCards=0 3 " | ||
"1 1,stack=20000 20000,bettingAbstraction=%s)", | ||
betting_abstraction); | ||
} | ||
|
||
std::string HulhGameString(const std::string &betting_abstraction) { | ||
return absl::StrFormat( | ||
"universal_poker(betting=limit,numPlayers=2,numRounds=4,blind=100 50," | ||
"firstPlayer=2 1,numSuits=4,numRanks=13,numHoleCards=2,numBoardCards=0 3 " | ||
"1 1,raiseSize=200 200 400 400,maxRaises=3 4 4 4,bettingAbstraction=%s)", | ||
betting_abstraction); | ||
} | ||
|
||
} // namespace open_spiel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright 2019 DeepMind Technologies Ltd. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef THIRD_PARTY_OPEN_SPIEL_CANONICAL_GAME_STRINGS_H_ | ||
#define THIRD_PARTY_OPEN_SPIEL_CANONICAL_GAME_STRINGS_H_ | ||
|
||
#include <string> | ||
|
||
// A place to store functions that return canonical game strings. These strings | ||
// can sent to LoadGame to load the game. | ||
|
||
namespace open_spiel { | ||
|
||
// Returns the "canonical" definition of Heads-up No-limit Texas Hold'em and | ||
// Heads-up Limit Texas Hold'em according to the ACPC: | ||
// http://www.computerpokercompetition.org/. | ||
// Valid values for betting_abstraction are "fc" for fold-call, and "fcpa" for | ||
// fold, call, pot, all-in. These indicate the actions that are allowed. Note | ||
// that in limit poker, "fcpa" is just the full game. | ||
// The string returned can be passed directly to LoadGame. | ||
std::string HunlGameString(const std::string &betting_abstraction); | ||
std::string HulhGameString(const std::string &betting_abstraction); | ||
|
||
} // namespace open_spiel | ||
|
||
#endif // THIRD_PARTY_OPEN_SPIEL_SPIEL_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters