ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/kgsueme/bin/kgsueme
Revision: 1.58
Committed: Thu May 20 23:09:53 2004 UTC (20 years ago) by pcg
Branch: MAIN
Changes since 1.57: +1 -1 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 pcg 1.25 #!/usr/bin/perl
2 pcg 1.1
3 pcg 1.32 use Glib;
4     use Gtk2;
5 pcg 1.1
6     use KGS::Protocol;
7     use KGS::Listener::Debug;
8    
9 pcg 1.16 use Audio::Data;
10     use Audio::Play;
11    
12 pcg 1.1 use IO::Socket::INET;
13 pcg 1.25 use List::Util;
14 pcg 1.1 use Errno;
15    
16 pcg 1.32 use Storable;
17 pcg 1.40 use Carp;
18 pcg 1.32
19     init Gtk2;
20 pcg 1.40
21     $SIG{QUIT} = sub { Carp::confess "SIGQUIT" };
22 pcg 1.1
23 pcg 1.26 our $HACK = 1; # do NEVER enable. ;)
24 pcg 1.29 our $DEBUG_EXPOSE = 0;
25 pcg 1.3
26 pcg 1.25 if ($HACK) {
27     $KGS::debug = 1;
28     }
29    
30 pcg 1.45 BEGIN {
31     our $VERSION = "0.1";
32 pcg 1.26
33 pcg 1.45 our $config;
34     our $LIBDIR = ".";
35 pcg 1.55
36     use KGS::Constants;
37 pcg 1.7
38 pcg 1.58 for (qw(util.pl gtk.pl chat.pl superchat.pl sound.pl user.pl gamelist.pl userlist.pl challenge.pl
39 pcg 1.55 game.pl room.pl roomlist.pl app.pl)) {
40     require (KGS::Constants::findfile "KGS/kgsueme/$_");
41     die if $@;
42 pcg 1.45 }
43 pcg 1.7 }
44    
45 pcg 1.50 our $app = new app;
46 pcg 1.1
47 pcg 1.54 if ($ENV{KGSUEME_DEBUG}) {
48 pcg 1.17 use KGS::Constants;
49    
50 pcg 1.25 for (19) {
51 pcg 1.52 my $game = new game size => $_;
52    
53     if (1) {
54 pcg 1.56 my $data = Storable::retrieve "board2.dat";
55 pcg 1.52 while (my ($k, $v) = each %$data) {
56     $game->{$k} = $v;
57     }
58     $game->event_update_tree;
59     }
60 pcg 1.26
61 pcg 1.52 if (0) {
62     $game->{cur_board} = new KGS::Game::Board;
63 pcg 1.47 my @x = (
64     #MARK_B,
65     #MARK_W,
66     #MARK_GRAY_B | MARK_SMALL_W,
67     #MARK_GRAY_W | MARK_SMALL_B,
68     #MARK_W | MARK_TRIANGLE,
69     0, 0, 0,
70     );
71     for $x (0..18) {
72     for $y (0..18) {
73 pcg 1.52 $game->{cur_board}{board}[$x][$y] =
74 pcg 1.47 $x[rand @x];
75     }
76     }
77    
78 pcg 1.52 $game->{cur_board}{board}[0][0] = MARK_B;
79     $game->{cur_board}{board}[1][1] = MARK_GRAY_B | MARK_SMALL_W;
80     $game->{cur_board}{board}[2][2] = MARK_W | MARK_TRIANGLE;
81     $game->{cur_board}{board}[1][2] = MARK_B | MARK_LABEL;
82     $game->{cur_board}{label}[1][2] = "198";
83     $game->{cur_board}{board}[0][2] = MARK_W | MARK_LABEL;
84     $game->{cur_board}{label}[0][2] = "AWA";
85     $game->{board}->set_board ($game->{cur_board});
86 pcg 1.26 }
87 pcg 1.52 $game->{window}->show_all;
88 pcg 1.25 }
89 pcg 1.12 }
90    
91 pcg 1.32 main Gtk2;
92 pcg 1.1
93 pcg 1.50 $app->destroy;
94 pcg 1.34
95     Gtk2->main_iteration while Gtk2->events_pending;
96    
97     1;
98 pcg 1.1
99