Test AI program in D

This commit is contained in:
Crom (Thibaut CHARLES) 2015-04-18 10:18:11 +02:00
parent 1ca571002e
commit fdb3b56623

20
TestingAI.d Normal file
View File

@ -0,0 +1,20 @@
#!dmd -run
import core.thread;
import std.stdio;
import std.socket;
import std.conv;
import std.utf;
void main() {
writeln("Start");
auto sock = new TcpSocket;
sock.blocking = 1;
sock.connect(new InternetAddress("127.0.0.1", 8080));
writeln("Connected");
auto msg = `{"action":"bind","target":"testnpc"}`;
sock.send(msg.toUTF8);
writeln("Sent");
Thread.sleep(dur!"seconds"(1));
}