module pingpong(rst,clk ,rule,p1,p2,r,g,b,hs,vs,seven_1,seven_2,seven_3);
input rst,clk;
input [2:0]rule;
input [1:0]p1,p2;
output [3:0]r,g,b;
output hs,vs;
output [6:0]seven_1,seven_2,seven_3;//seven segment,//"p1" "-" "p2"
wire [7:0]p1_size,p2_size;
wire [3:0]p1_point,p2_point;
wire [9:0]p1_pos,p2_pos;
wire b_clk;
wire [10:0]ball_posx;
wire [9:0]ball_posy;

game_rule_setter rule_holder (.rst(b_rst),.clk(clk),.p1_point(p1_point),.p2_point(p2_point),.rule(rule),.p1_size(p1_size),.p2_size(p2_size),.b_clk(b_clk));
player_move player1 (.rst(rst),.clk(clk),.in(p1),.size(p1_size),.pos(p1_pos));
player_move player2 (.rst(rst),.clk(clk),.in(p2),.size(p2_size),.pos(p2_pos));
ball_pos ball (
    .b_clk(b_clk),.b_rst(b_rst),.ball_posx(ball_posx),.ball_posy(ball_posy),
    .p1_pos(p1_pos),.p2_pos(p2_pos),.p1_size(p1_size),.p2_size(p2_size));
vga DIS (
    .clk(clk),
    .p1_pos(p1_pos),.p2_pos(p2_pos),.p1_size(p1_size),.p2_size(p2_size),.ball_posx(ball_posx),.ball_posy(ball_posy),
    .VGA_r(r),.VGA_g(g),.VGA_b(b),.hs(hs),.vs(vs));
referee noob (.rst(rst),.clk(clk),.ball_posx(ball_posx),.b_rst(b_rst),.seven_1(seven_1),.seven_2(seven_2),.seven_3(seven_3),.p1_point(p1_point),.p2_point(p2_point));
endmodule