Ruby版サンプルクライアント †#!/usr/bin/ruby require "socket" def get_info pkt =$sock.recvfrom(4096) $port = pkt[1][1] info = pkt[0].chop end def send_cmd(cmd) $sock.send("#{cmd}\0",0,"localhost",$port) cmd end # main $team = ARGV[0] $sock = UDPSocket.open $port = 6000 send_cmd("(init #{$team} (version 13))") info = get_info send_cmd("(move -10 0)") while true cur_info = get_info p cur_info end |