File tree Expand file tree Collapse file tree 6 files changed +37
-164
lines changed Expand file tree Collapse file tree 6 files changed +37
-164
lines changed Original file line number Diff line number Diff line change @@ -973,6 +973,41 @@ pzpr.classmgr.makeCommon({
973
973
code
974
974
) ;
975
975
} ,
976
+ checkShadeCount : function ( ) {
977
+ this . checkRowsCols ( this . isExCellCount , "exShadeNe" ) ;
978
+ } ,
979
+ getRowsColsValue : function ( clist ) {
980
+ return clist . filter ( function ( c ) {
981
+ return c . isShade ( ) ;
982
+ } ) . length ;
983
+ } ,
984
+ isExCellCount : function ( clist ) {
985
+ var d = clist . getRectSize ( ) ,
986
+ bd = this . board ;
987
+ var count = this . getRowsColsValue ( clist ) ;
988
+
989
+ var result = true ;
990
+
991
+ if ( d . x1 === d . x2 ) {
992
+ var exc = bd . getex ( d . x1 , - 1 ) ;
993
+ if ( exc . qnum !== - 1 && exc . qnum !== count ) {
994
+ exc . seterr ( 1 ) ;
995
+ result = false ;
996
+ }
997
+ }
998
+ if ( d . y1 === d . y2 ) {
999
+ var exc = bd . getex ( - 1 , d . y1 ) ;
1000
+ if ( exc . qnum !== - 1 && exc . qnum !== count ) {
1001
+ exc . seterr ( 1 ) ;
1002
+ result = false ;
1003
+ }
1004
+ }
1005
+
1006
+ if ( ! result ) {
1007
+ clist . seterr ( 1 ) ;
1008
+ }
1009
+ return result ;
1010
+ } ,
976
1011
977
1012
//---------------------------------------------------------------------------
978
1013
// ans.checkBorderCount() ある交点との周り四方向の境界線の数を判定する(bp==1:黒点が打たれている場合)
Original file line number Diff line number Diff line change 377
377
clist . seterr ( 1 ) ;
378
378
}
379
379
}
380
- } ,
381
-
382
- checkShadeCount : function ( ) {
383
- this . checkRowsCols ( this . isExCellCount , "exShadeNe" ) ;
384
- } ,
385
-
386
- isExCellCount : function ( clist ) {
387
- var d = clist . getRectSize ( ) ,
388
- bd = this . board ;
389
- var count = clist . filter ( function ( c ) {
390
- return c . isShade ( ) ;
391
- } ) . length ;
392
-
393
- var result = true ;
394
-
395
- if ( d . x1 === d . x2 ) {
396
- var exc = bd . getex ( d . x1 , - 1 ) ;
397
- if ( exc . qnum !== - 1 && exc . qnum !== count ) {
398
- exc . seterr ( 1 ) ;
399
- result = false ;
400
- }
401
- }
402
- if ( d . y1 === d . y2 ) {
403
- var exc = bd . getex ( - 1 , d . y1 ) ;
404
- if ( exc . qnum !== - 1 && exc . qnum !== count ) {
405
- exc . seterr ( 1 ) ;
406
- result = false ;
407
- }
408
- }
409
-
410
- if ( ! result ) {
411
- clist . seterr ( 1 ) ;
412
- }
413
- return result ;
414
380
}
415
381
}
416
382
} ) ;
Original file line number Diff line number Diff line change 413
413
var ca = shaded [ 0 ] ;
414
414
var cb = shaded [ 1 ] ;
415
415
return ca . bx !== cb . bx && ca . by !== cb . by ;
416
- } ,
417
-
418
- checkShadeCount : function ( ) {
419
- this . checkRowsCols ( this . isExCellCount , "exShadeNe" ) ;
420
- } ,
421
-
422
- isExCellCount : function ( clist ) {
423
- var d = clist . getRectSize ( ) ,
424
- bd = this . board ;
425
- var count = clist . filter ( function ( c ) {
426
- return c . isShade ( ) ;
427
- } ) . length ;
428
-
429
- var result = true ;
430
-
431
- if ( d . x1 === d . x2 ) {
432
- var exc = bd . getex ( d . x1 , - 1 ) ;
433
- if ( exc . qnum !== - 1 && exc . qnum !== count ) {
434
- exc . seterr ( 1 ) ;
435
- result = false ;
436
- }
437
- }
438
- if ( d . y1 === d . y2 ) {
439
- var exc = bd . getex ( - 1 , d . y1 ) ;
440
- if ( exc . qnum !== - 1 && exc . qnum !== count ) {
441
- exc . seterr ( 1 ) ;
442
- result = false ;
443
- }
444
- }
445
-
446
- if ( ! result ) {
447
- clist . seterr ( 1 ) ;
448
- }
449
- return result ;
450
416
}
451
417
}
452
418
} ) ;
Original file line number Diff line number Diff line change 311
311
return ! cell . isShade ( ) && cell . qnum > 0 ;
312
312
} , "circleUnshade" ) ;
313
313
} ,
314
-
315
- checkShadeCount : function ( ) {
316
- this . checkRowsCols ( this . isExCellCount , "exShadeNe" ) ;
317
- } ,
318
-
319
314
checkShadeLoop : function ( ) {
320
315
var snakes = this . board . sblkmgr . components ;
321
316
for ( var r = 0 ; r < snakes . length ; r ++ ) {
338
333
}
339
334
}
340
335
}
341
- } ,
342
-
343
- isExCellCount : function ( clist ) {
344
- var d = clist . getRectSize ( ) ,
345
- bd = this . board ;
346
- var count = clist . filter ( function ( c ) {
347
- return c . isShade ( ) ;
348
- } ) . length ;
349
-
350
- var result = true ;
351
-
352
- if ( d . x1 === d . x2 ) {
353
- var exc = bd . getex ( d . x1 , - 1 ) ;
354
- if ( exc . qnum !== - 1 && exc . qnum !== count ) {
355
- exc . seterr ( 1 ) ;
356
- result = false ;
357
- }
358
- }
359
- if ( d . y1 === d . y2 ) {
360
- var exc = bd . getex ( - 1 , d . y1 ) ;
361
- if ( exc . qnum !== - 1 && exc . qnum !== count ) {
362
- exc . seterr ( 1 ) ;
363
- result = false ;
364
- }
365
- }
366
-
367
- if ( ! result ) {
368
- clist . seterr ( 1 ) ;
369
- }
370
- return result ;
371
336
}
372
337
}
373
338
} ) ;
Original file line number Diff line number Diff line change 2225
2225
}
2226
2226
return cell . isShade ( ) && cell . qnum !== cell . getShape ( ) ;
2227
2227
} , "csMismatch" ) ;
2228
- } ,
2229
-
2230
- checkShadeCount : function ( ) {
2231
- this . checkRowsCols ( this . isExCellCount , "exShadeNe" ) ;
2232
- } ,
2233
-
2234
- isExCellCount : function ( clist ) {
2235
- var d = clist . getRectSize ( ) ,
2236
- bd = this . board ;
2237
- var count = clist . filter ( function ( c ) {
2238
- return c . isShade ( ) ;
2239
- } ) . length ;
2240
-
2241
- var result = true ;
2242
-
2243
- if ( d . x1 === d . x2 ) {
2244
- var exc = bd . getex ( d . x1 , - 1 ) ;
2245
- if ( exc . qnum !== - 1 && exc . qnum !== count ) {
2246
- exc . seterr ( 1 ) ;
2247
- result = false ;
2248
- }
2249
- }
2250
- if ( d . y1 === d . y2 ) {
2251
- var exc = bd . getex ( - 1 , d . y1 ) ;
2252
- if ( exc . qnum !== - 1 && exc . qnum !== count ) {
2253
- exc . seterr ( 1 ) ;
2254
- result = false ;
2255
- }
2256
- }
2257
-
2258
- if ( ! result ) {
2259
- clist . seterr ( 1 ) ;
2260
- }
2261
- return result ;
2262
2228
}
2263
2229
} ,
2264
2230
"AnsCheck@pentatouch" : {
Original file line number Diff line number Diff line change 651
651
checkTentCount : function ( ) {
652
652
this . checkRowsCols ( this . isExCellCount , "exTentNe" ) ;
653
653
} ,
654
-
655
- isExCellCount : function ( clist ) {
656
- var d = clist . getRectSize ( ) ,
657
- bd = this . board ;
658
- var count = clist . filter ( function ( c ) {
654
+ getRowsColsValue : function ( clist ) {
655
+ return clist . filter ( function ( c ) {
659
656
return c . getNum ( ) === 2 ;
660
657
} ) . length ;
661
-
662
- var result = true ;
663
-
664
- if ( d . x1 === d . x2 ) {
665
- var exc = bd . getex ( d . x1 , - 1 ) ;
666
- if ( exc . qnum !== - 1 && exc . qnum !== count ) {
667
- exc . seterr ( 1 ) ;
668
- result = false ;
669
- }
670
- }
671
- if ( d . y1 === d . y2 ) {
672
- var exc = bd . getex ( - 1 , d . y1 ) ;
673
- if ( exc . qnum !== - 1 && exc . qnum !== count ) {
674
- exc . seterr ( 1 ) ;
675
- result = false ;
676
- }
677
- }
678
-
679
- if ( ! result ) {
680
- clist . seterr ( 1 ) ;
681
- }
682
- return result ;
683
658
}
684
659
}
685
660
} ) ;
You can’t perform that action at this time.
0 commit comments