Merge branch 'master' into 28c3a8

This commit is contained in:
Frank Becker 2011-12-18 13:52:41 +01:00
commit f822d9ab54
7 changed files with 110 additions and 15 deletions

1
10-pentabuzzer.rules Normal file
View File

@ -0,0 +1 @@
SUBSYSTEM=="usb", ATTRS{idProduct}=="6001", ATTRS{idVendor}=="0403", ATTRS{serial}=="A400gqnA", NAME="pentabuzzer", OWNER="john",SYMLINK="serial/by-id/usb-FTDI_FT232R_USB_UART_A400gqnA-if00-port0"

@ -1 +1 @@
Subproject commit fbac8e20554a8356f2b3984412a2b70f712ab0e0
Subproject commit 6f1b5a9fed76b7dfbdce042d170405b0f1f7b700

View File

@ -6,6 +6,9 @@
<script type="text/javascript" src="jquery-1.4.2.js" defer></script>
<script type="text/javascript" src="censor.js" defer></script>
<style>
body {
font-size: 180%;
}
.image {
background-color: #ccc;
border-radius: 4px;

View File

@ -35,7 +35,6 @@
<img src="irc.png" class="irc">
<img src="fwd.png" class="fwd">
<img src="morse.png" class="morse">
<img src="leak.png" class="leak">
<img src="gif.png" class="gif">
</li>
<li class="player1"><span class="name"></span><span class="score">0</span>
@ -45,7 +44,6 @@
<img src="irc.png" class="irc">
<img src="fwd.png" class="fwd">
<img src="morse.png" class="morse">
<img src="leak.png" class="leak">
<img src="gif.png" class="gif">
</li>
<li class="player2"><span class="name"></span><span class="score">0</span>
@ -55,7 +53,6 @@
<img src="irc.png" class="irc">
<img src="fwd.png" class="fwd">
<img src="morse.png" class="morse">
<img src="leak.png" class="leak">
<img src="gif.png" class="gif">
</li>
</ul>
@ -103,7 +100,6 @@
<img src="irc.png" class="irc">
<img src="fwd.png" class="fwd">
<img src="morse.png" class="morse">
<img src="leak.png" class="leak">
<img src="gif.png" class="gif">
</dd>
<dt class="p1"></dt>
@ -114,7 +110,6 @@
<img src="irc.png" class="irc">
<img src="fwd.png" class="fwd">
<img src="morse.png" class="morse">
<img src="leak.png" class="leak">
<img src="gif.png" class="gif">
</dd>
<dt class="p2"></dt>
@ -125,7 +120,6 @@
<img src="irc.png" class="irc">
<img src="fwd.png" class="fwd">
<img src="morse.png" class="morse">
<img src="leak.png" class="leak">
<img src="gif.png" class="gif">
</dd>
</dl>

26
quiz.js
View File

@ -265,13 +265,25 @@ function takeJoker(activePlayer, joker) {
$('#players .player' + activePlayer + ' .' + joker).hide();
if (joker === 'fiftyfifty') {
var h1, h2, answers = questions[currentQuestion].answers;
do {
h1 = Math.floor(Math.random() * 4);
h2 = Math.floor(Math.random() * 4);
} while(answers[h1].right || answers[h2].right || h1 === h2);
$('#answer' + h1).fadeTo(500, 0.1);
$('#answer' + h2).fadeTo(500, 0.1);
var h1, h2, answers = questions[currentQuestion].answers;
var i,rightcount = 0;
for (i=0;i<4;i++){
if (answers[i].right ) {
rightcount++ ;
}
}
if (rightcount >= 3) {
$('#answer' + 1).fadeTo(500, 0.1);
$('#answer' + 2).fadeTo(500, 0.1);
} else {
do {
h1 = Math.floor(Math.random() * 4);
h2 = Math.floor(Math.random() * 4);
} while(answers[h1].right || answers[h2].right || h1 === h2);
$('#answer' + h1).fadeTo(500, 0.1);
$('#answer' + h2).fadeTo(500, 0.1);
}
}
if (joker === 'nedap') {
var q = questions[currentQuestion];

View File

@ -56,7 +56,7 @@ var IRC_SERVER = 'irc.hackint.eu';
var IRC_CHAN = '#pentanews';
var chat = new irc({ server: IRC_SERVER,
encoding: 'utf-8',
nick: '[Ceiling]Cat'
nick: '[Ceiling]Katze'
});
function connectChat() {
chat.connect();

85
tools/roundswitch/rsw.sh.c Executable file
View File

@ -0,0 +1,85 @@
#!/usr/bin/tcc -run
/*
*
* ============================================================================
*
* Filename: rsw.sh.c
*
* Description:
*
* Version: 1.0
* Created: 14.12.2011 01:31:04
* Revision: none
*
* Author: john@tuxcode.org
* Company: tuxcode.org
*
* ============================================================================
*/
#include <stdio.h>
#include <limits.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#define DATAPATH "/home/john/tuxgit/pentagameshow/data/"
#define ROUNDFOMAT DATAPATH "round_%d.json"
#define ACTIROUND DATAPATH "questions.json"
static void usage(){
puts(
"bitte gib die rundennummer as einzigeb aufrufparameter ein\n"
"die rundennummer ist eine Natürliche Zahl in ascii Darstellung\n"
"zwischen 1 und 5 \n"
);
exit(1);
}
int
main ( int argc, char *argv[] )
{
long int i;
char *eptr;
char act[128];
if (argc != 2)
usage();
errno = 0;
i = strtol(argv[1],&eptr,0);
if ((errno == ERANGE && (i == LONG_MAX || i == LONG_MIN))
|| (errno != 0 && i == 0)) {
perror("strtol");
exit(EXIT_FAILURE);
}
if (eptr == argv[1]) {
fprintf(stderr, "No digits were found\n");
exit(EXIT_FAILURE);
}
if ((i <1) || (i>5)){
fprintf(stderr, "Round Number out of Range (1-5)\n");
exit(EXIT_FAILURE);
}
if (remove(ACTIROUND)){
fprintf(stderr, "Unable to remove old stufffz\n");
}
if ( 6 > snprintf(act,128,ROUNDFOMAT,i)) {
fprintf(stderr, "wudurudu\n");
exit(EXIT_FAILURE);
}
symlink(act,ACTIROUND);
return 0;
} /* ---------- end of function main ---------- */