トップ 一覧 検索 ヘルプ RSS ログイン

chabo - AI(Artificial incompetence) chabo(chat bot) moduleの変更点

+ my $clients = {};
+ my $jankenStat = 0;
+ my $handItem = {'&#x270A'=> 0, '&#x270C'=> 1, '&#x270B'=> 2};
+ my $handArray = [sort {$handItem->{$a} <=> $handItem->{$b}} keys %$handItem];
+ my $hand = {};
+ my $win = '';
+ my $cpname = 'ちゃぼ';
+ my $DEBUG = 0;
+ 
+    $self->stash->{hand} = $handArray;
- my $clients = {};
- my $jankenStat = 0;
- my $handItem = {'&#x270A'=> 0, '&#x270C'=> 1, '&#x270B'=> 2};
- my $handArray = [sort {$handItem->{$a} <=> $handItem->{$b}} keys %$handItem];
- my $hand = {};
- my $win = '';
- my $cpname = 'ちゃぼ';
- my $DEBUG = 0;
-    ws.send($('#name').val() + "\t" + '&#x270A');
+    ws.send($('#name').val() + "\t" + '<%== $hand->[0] %>');
-    ws.send($('#name').val() + "\t" + '&#x270C');
+    ws.send($('#name').val() + "\t" + '<%== $hand->[1] %>');
-    ws.send($('#name').val() + "\t" + '&#x270B');
+    ws.send($('#name').val() + "\t" + '<%== $hand->[2] %>');
-   <button type="button" id="gu"><font size=50>&#x270A;</font></button>
-   <button type="button" id="choki"><font size=50>&#x270C;</font></button>
-   <button type="button" id="pa"><font size=50>&#x270B;</font></button>
+   <button type="button" id="gu"><font size=50><%== $hand->[0] %></font></button>
+   <button type="button" id="choki"><font size=50><%== $hand->[1] %></font></button>
+   <button type="button" id="pa"><font size=50><%== $hand->[2] %></font></button>