Files
dl_old/dlconsole/main.cpp
T
2024-07-03 18:02:17 +08:00

75 lines
1.1 KiB
C++

#include <dl.h>
using namespace dl;
//Client client;
//void client_send(void*)
//{
// while (true)
// {
// //client.Send("客户端发送数据");
// std::this_thread::sleep_for(std::chrono::seconds(2));
// }
//}
int main()
{
//String::TestSplit();
Engine::Init();
//Mat::Test();
/*Thread* t = g_thread->Create();
t->Start(client_send, nullptr);*/
//{
// Server server;
// if (!server.Accept())
// {
// log_err("服务器Accept失败!");
// return -1;
// }
// server.Run();
// Client client;
// if (!client.Connent())
// {
// log_err("客户端Connect失败!");
// return -1;
// }
// size_t i = 0;
// while (i++ < 10)
// {
// log_info("客户端发送!");
// client.Send(CreateBufferView("Hello dl!"));
// std::this_thread::sleep_for(std::chrono::seconds(1));
// }
//}
// ScriptBlock block = g_script->Compile(R"(
//print "hello dl!"
//a = 1
//b = 2
//print a + b
//c = 3
//print a + b * c
//print(a+b)*c
// )");
ScriptBlock block = g_script->Compile(R"(
a = 1
b = 2
c = 3
print a+b*c
d = 4
e = 5
print a+((b+c)*d)*e
)");
ScriptVM vm;
vm.Execute(block);
Engine::Release();
return 0;
}