@@ -1227,8 +1227,10 @@ $(document).ready(function () {
1227
1227
wRender . moveSouth ( ) ;
1228
1228
saveWorld = false ;
1229
1229
} else if ( currentCell && event . which >= 96 && event . which <= 105 ) {
1230
+ // numpad 0 - numpad 9
1230
1231
mundo . setBuzzers ( currentCell . row , currentCell . column , event . which - 96 ) ;
1231
1232
} else if ( currentCell && event . which >= 48 && event . which <= 57 ) {
1233
+ // 0 - 9
1232
1234
mundo . setBuzzers ( currentCell . row , currentCell . column , event . which - 48 ) ;
1233
1235
} else if ( currentCell && event . which == 73 ) {
1234
1236
// I
@@ -1256,6 +1258,12 @@ $(document).ready(function () {
1256
1258
// K
1257
1259
mundo . move ( currentCell . row , currentCell . column ) ;
1258
1260
mundo . rotate ( ) ;
1261
+ } else if ( currentCell && event . which == 79 ) {
1262
+ // O
1263
+ mundo . rotate ( ) ;
1264
+ } else if ( currentCell && event . which == 80 ) {
1265
+ // P
1266
+ mundo . move ( currentCell . row , currentCell . column ) ;
1259
1267
} else {
1260
1268
repaint = false ;
1261
1269
}
@@ -1509,13 +1517,12 @@ $(document).ready(function () {
1509
1517
} ) ;
1510
1518
$ ( '#filas' ) . blur ( function ( event ) {
1511
1519
var valor = parseInt ( $ ( this ) . val ( ) ) ;
1512
- if ( 0 > valor || valor > 10000 || valor == h || Number . isNaN ( valor ) ) {
1520
+ if ( valor <= 0 || valor > 10000 || valor == h || Number . isNaN ( valor ) ) {
1513
1521
$ ( this ) . val ( h ) ;
1514
1522
return ;
1515
1523
}
1516
1524
h = valor ;
1517
1525
mundo . resize ( w , h ) ;
1518
- addEventListeners ( mundo ) ;
1519
1526
wRender = new WorldRender ( context , h , w ) ;
1520
1527
wRender . paint ( mundo , world . width , world . height , {
1521
1528
editable : true ,
@@ -1525,13 +1532,12 @@ $(document).ready(function () {
1525
1532
} ) ;
1526
1533
$ ( '#columnas' ) . blur ( function ( event ) {
1527
1534
var valor = parseInt ( $ ( this ) . val ( ) ) ;
1528
- if ( 0 > valor || valor > 10000 || valor == w || Number . isNaN ( valor ) ) {
1535
+ if ( valor <= 0 || valor > 10000 || valor == w || Number . isNaN ( valor ) ) {
1529
1536
$ ( this ) . val ( w ) ;
1530
1537
return ;
1531
1538
}
1532
1539
w = valor ;
1533
1540
mundo . resize ( w , h ) ;
1534
- addEventListeners ( mundo ) ;
1535
1541
wRender = new WorldRender ( context , h , w ) ;
1536
1542
wRender . paint ( mundo , world . width , world . height , {
1537
1543
editable : true ,
0 commit comments