Skip to content

Commit 0e062ae

Browse files
committed
Added rainman
1 parent 3d6e40a commit 0e062ae

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

‎src/PokerPlayer.cs‎

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4+
using System.Net;
45
using System.Security.Cryptography.X509Certificates;
56
using Newtonsoft.Json.Linq;
67

@@ -157,11 +158,46 @@ private static bool GetPlay(out int betValue, List<Tuple<string,string>> cards,
157158
}
158159
}
159160
}
161+
}
162+
163+
try
164+
{
165+
string address = "http://rainman.leanpoker.org/rank";
166+
string reply = null;
167+
using (WebClient client = new WebClient())
168+
{
169+
client.Headers.Add("Content-Type", "application/json");
170+
reply = client.UploadString(address, "cards=[\r\n {\"rank\":\"5\",\"suit\":\"diamonds\"},\r\n {\"rank\":\"6\",\"suit\":\"diamonds\"},\r\n {\"rank\":\"7\",\"suit\":\"diamonds\"},\r\n {\"rank\":\"7\",\"suit\":\"spades\"},\r\n {\"rank\":\"8\",\"suit\":\"diamonds\"},\r\n {\"rank\":\"9\",\"suit\":\"diamonds\"}\r\n]");
171+
Console.Error.WriteLine(reply);
172+
}
173+
}
174+
catch (Exception ex)
175+
{
176+
Console.Error.WriteLine(ex);
177+
}
160178

161179

180+
var commCount = communityCards.Count();
162181

163-
182+
// We have the flop on the table.
183+
if (commCount == 3)
184+
{
185+
// Can we do something with the cards?
164186
}
187+
188+
// We have the turn on the table.
189+
if (commCount == 4)
190+
{
191+
// Can we do something with the cards?
192+
}
193+
194+
// We have the river on the table.
195+
if (commCount == 5)
196+
{
197+
// Can we do something with the cards?
198+
}
199+
200+
165201
betValue = 0;
166202
return false;
167203
}

0 commit comments

Comments
 (0)