-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTest.java
34 lines (32 loc) · 897 Bytes
/
Test.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package gobang;
import java.util.Scanner;
/**
* <p> 测试 </p>
*
* @author 汤卫豪
* @version V1.0
* @projectName OOP
* @package gobang
* @className Test
* @date 2021/9/29 20:50
**/
public class Test {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("你是否要作为房主(Y/N)");
String s = sc.next();
if ("N".equals(s)) {
int port = 6666;
Receiver receiver = new Receiver(port);
System.out.println("连接成功");
receiver.startGame();
} else {
System.out.println("对方的ip地址是:");
String ip = sc.nextLine();
int port = 6666;
Sender sender = new Sender(20, 20, 30, 10, ip, port);
System.out.println("连接成功");
sender.startGame();
}
}
}