Project

General

Profile

« Previous | Next » 

Revision c0495b7d

Added by Leszek Koltunski about 4 years ago

Pretty Patterns: some patterns had 'empty' moves (i.e. angle 0). Protect the parser against such sequences and correct the first 12 such patterns.

View differences:

src/main/java/org/distorted/patterns/RubikPattern.java
255 255
          }
256 256
        else
257 257
          {
258
          mCanRotate = false;
259

  
260 258
          int axis     =moves[curMove-1][0];
261 259
		      int rowBitmap=moves[curMove-1][1];
262 260
		      int bareAngle=moves[curMove-1][2];
263 261
          int angle    = bareAngle*(360/object.getBasicAngle());
264 262
          int numRot   = Math.abs(bareAngle);
265 263

  
266
          post.addRotation(this, axis, rowBitmap, angle, numRot*DURATION_MILLIS);
264
          if( angle!=0 )
265
            {
266
            mCanRotate = false;
267
            post.addRotation(this, axis, rowBitmap, angle, numRot*DURATION_MILLIS);
268
            }
269
          else
270
            {
271
            android.util.Log.e("pattern", "error: pattern "+nameStr+" move "+(curMove-1)+" angle 0");
272
            }
267 273
          }
268 274
        }
269 275
      else
......
296 302
          }
297 303
        else
298 304
          {
299
          mCanRotate = false;
300

  
301 305
          int axis     =moves[curMove][0];
302 306
		      int rowBitmap=moves[curMove][1];
303 307
		      int bareAngle=moves[curMove][2];
304 308
          int angle    = bareAngle*(360/object.getBasicAngle());
305 309
          int numRot   = Math.abs(bareAngle);
306 310

  
307
          post.addRotation(this, axis, rowBitmap, -angle, numRot*DURATION_MILLIS);
311
          if( angle!=0 )
312
            {
313
            mCanRotate = false;
314
            post.addRotation(this, axis, rowBitmap, -angle, numRot*DURATION_MILLIS);
315
            }
316
          else
317
            {
318
            android.util.Log.e("pattern", "error: pattern "+nameStr+" move "+curMove+" angle 0");
319
            }
308 320
          }
309 321
        }
310 322
      else
src/main/java/org/distorted/patterns/RubikPatternData5.java
354 354
	"2 Chessboard Cubes (4x4x4): 013 651 360 653 333 651 360 653 331 011 163 801 360 803 483 801 360 803 481 330 804 011 331 164 013 481 163 483 164 484 161 803 331 161 483 041 363 043 361 101 423 103 421",
355 355
	"2 Cubes in a Chessboard Cube (3x3x3): 483 651 331 163 360 084 360 084 651 360 653 360 161 333 653 482 650 011 484 333 783 484 331 781 013 650 511 671 350 673 563 033 350 243 673 560 883 353 243 560 241 561 811 484 804 491 013 404 011 493 013 404 011 804 484 813",
356 356
	"2 Cubes in a Chessboard Cube (4x4x4): 483 651 331 163 420 651 420 653 161 333 653 010 331 163 653 163 653 163 653 333 010 483 164 804 560 044 404 044",
357
	"6 Dots in a Chessboard Cube: 483 651 331 163 360 084 360 084 651 360 653 360 161 333 653 482 650 011 484 333 783 484 331 781 013 650 511 671 350 673 563 033 350 243 673 560 883 353 243 560 241 561 811 484 804 491 013 404 011 493 013 404 011 804 484 813 484 650 163 011 663 401 661 403 161 013 650 484",
357
	"6 Dots in a Chessboard Cube: 483 651 331 163 360 084 360 084 651 360 653 360 161 333 653 650 011 484 333 783 484 331 781 013 650 511 671 350 673 563 033 350 243 673 560 883 353 243 560 241 561 811 484 804 491 013 404 011 493 013 404 011 804 484 813 484 650 163 011 663 401 661 403 161 013 650 484",
358 358
	"2 Cube in a Cube, With Propeller: 563 240 563 030 880 030 881 240 561 033 673 243 351 883 563 031 673 030 813 010 650 173 481 084 483 171 481 084 483 650 010 811",
359 359
	"Ripple: 481 333 163 011 650 141 463 143 461 121 363 083 403 043 441 650 013 161 331 483",
360 360
	"Reverse Ripple: 483 331 161 013 804 141 463 143 461 121 363 083 403 043 441 804 011 163 333 481",
361
	"Interlaced Spirals: 801 164 333 173 803 163 011 803 331 803 493 013 482 161 724 163 803 161 760 163 801 161 684 163 481 333 011 660 013 653 011 700 013 651 011 680 013 333 804 161 013 341 783 361 343 781 363 163 011 804 490 801 653 010 021 343 023 341 010 651 803 484",
361
	"Interlaced Spirals: 801 164 333 173 803 163 011 803 331 803 493 013 161 724 163 803 161 760 163 801 161 684 163 481 333 011 660 013 653 011 700 013 651 011 680 013 333 804 161 013 341 783 361 343 781 363 163 011 804 490 801 653 010 021 343 023 341 010 651 803 484",
362 362
	"M.C. Escher [1]: 143 781 141 743 043 683 041 801 164 333 173 803 163 011 803 331 803 493 013 481 561 883 044 881 161 883 044 881 163 563 351 673 044 671 011 673 044 671 013 353 813 010 650 481 084 483 173 481 084 483 171 650 010 811 484 650 163 011 663 401 661 403 161 013 650 484",
363 363
	"M.C. Escher [2]: 483 163 653 481 801 493 163 651 013 813 484 801 161 043 681 041 683 563 241 684 243 803 241 684 243 801 561 353 031 684 033 653 031 684 033 651 351 813 010 650 173 481 084 483 171 481 084 483 650 010 811 484 010 801 653 021 403 023 401 803 651 010 484",
364 364
    "Corner Axis (3)",
......
379 379
	"6 Dots in a Cube in a Cube [3]: 164 330 081 661 081 663 083 343 083 330 341 164 341 011 343 084 341 013 343 084 243 670 031 883 353 883 353 883 353 033 670 243 880 560 240",
380 380
	"6 Dots in a Cube in a Cube [4]: 164 330 081 661 081 663 083 343 083 330 341 164 341 011 343 084 341 013 343 240 084 560 880 241 670 031 351 881 351 881 351 881 033 670 241",
381 381
	"2 Color Chessboard Cubes: 484 331 013 804 483 011 811 171 801 333 010 803 403 340 881 030 351 883 273 913 033 561 880 031 560 353",
382
	"6 Dots in a Chessboard Cube: 483 651 331 163 360 084 360 084 651 360 653 360 161 333 653 482 650 011 484 333 783 484 331 781 013 650 481 164 330 081 661 081 663 083 343 083 330 341 164 341 011 343 084 341 013 343 084 351 671 350 673 563 033 350 243 673 560 883 353 243 560 241 561 811 484 804 491 013 404 011 493 013 404 011 804 484 813",
383
	"2 Corner Triangles, 6 Triangles: 330 803 013 483 010 331 010 651 161 484 653 010 651 163 483 163 651 482 650 163 333 031 363 041 403 063 441 013 331 161 650 483",
382
	"6 Dots in a Chessboard Cube: 483 651 331 163 360 084 360 084 651 360 653 360 161 333 653 650 011 484 333 783 484 331 781 013 650 481 164 330 081 661 081 663 083 343 083 330 341 164 341 011 343 084 341 013 343 084 351 671 350 673 563 033 350 243 673 560 883 353 243 560 241 561 811 484 804 491 013 404 011 493 013 404 011 804 484 813",
383
	"2 Corner Triangles, 6 Triangles: 330 803 013 483 010 331 010 651 161 484 653 010 651 163 483 163 651 650 163 333 031 363 041 403 063 441 013 331 161 650 483",
384 384
    "Asymmetric",
385 385
	"Big Edge Triangle, 3 Bars: 653 341 010 343 013 723 010 721 331 084 333 011 331 084 333 651",
386 386
	"Big Edge Triangle (Backside), 3 Bars: 161 483 660 481 801 483 660 481 021 804 023 803 403 804 401 163",
387 387
	"Big Edge Triangle, 3 Bars: 653 401 010 403 013 663 010 661 331 020 333 011 331 020 333 651",
388 388
	"Big Edge Triangle (Backside), 3 Bars: 161 483 724 481 801 483 724 481 081 804 083 803 343 804 341 163",
389
	"Big Edge Triangle, 3 Speckled Bars: 653 341 010 343 013 723 010 721 331 084 333 011 331 084 333 652 341 010 343 101 341 010 343 103 651",
390
	"Big Edge Triangle (Backside), 3 Speckled Bars: 161 743 403 804 401 741 403 804 401 162 483 660 481 801 483 660 481 021 804 023 803 403 804 401 163",
391
	"Big Edge Triangle, 3 Speckled Bars: 653 101 341 010 343 103 341 010 343 652 331 084 333 013 331 084 333 723 010 721 011 341 010 343 651",
392
	"Big Edge Triangle (Backside), 3 Speckled Bars: 161 403 804 401 801 021 804 023 483 660 481 803 483 660 481 162 403 804 401 743 403 804 401 741 163",
389
	"Big Edge Triangle, 3 Speckled Bars: 653 341 010 343 013 723 010 721 331 084 333 011 331 084 333 341 010 343 101 341 010 343 103 651",
390
	"Big Edge Triangle (Backside), 3 Speckled Bars: 161 743 403 804 401 741 403 804 401 483 660 481 801 483 660 481 021 804 023 803 403 804 401 163",
391
	"Big Edge Triangle, 3 Speckled Bars: 653 101 341 010 343 103 341 010 343 331 084 333 013 331 084 333 723 010 721 011 341 010 343 651",
392
	"Big Edge Triangle (Backside), 3 Speckled Bars: 161 403 804 401 801 021 804 023 483 660 481 803 483 660 481 403 804 401 743 403 804 401 741 163",
393 393
	"Peak, Big Peak: 084 404 880 013 331 013 803 481 803 483 804 010 333 880 404 084",
394 394
	"Peak (Backside), Big Peak: 660 340 030 483 804 010 333 013 331 013 803 481 803 030 340 660",
395 395
	"Triangle, Ring: 660 340 020 163 483 801 380 803 481 801 380 803 161 020 340 660 330 804 161 013 723 341 721 343 163 011 804 330",
......
404 404
	"Asymmetric Anaconda (Backside): 653 401 010 403 013 663 010 661 011 811 343 661 341 803 343 663 341 011 671 021 670 023 673 403 670 401 013",
405 405
	"Anaconda (Type 3) [1]: 163 661 484 663 483 083 484 081 481 161 013 721 330 723 333 023 330 021 331 013 801 653 484 343 121 363 021 381 143 484 651 803 010",
406 406
	"Anaconda (Type 3) [2]: 651 331 661 330 663 333 083 330 081 653 801 481 721 484 723 483 023 484 021 801 013 161 330 783 441 721 363 701 403 330 163 011 804",
407
	"Anaconda (Type 6): 681 164 804 333 044 331 171 333 044 331 173 804 164 683 481 333 803 651 164 763 341 761 343 164 801 653 483 332 481 650 163 011 403 061 401 063 161 013 650 483 331",
407
	"Anaconda (Type 6): 681 164 804 333 044 331 171 333 044 331 173 804 164 683 481 333 803 651 164 763 341 761 343 164 801 653 483 481 650 163 011 403 061 401 063 161 013 650 483 331",
408 408
	"Anaconda [1]: 801 653 010 484 383 061 381 063 484 010 651 383 243 484 241 381 243 484 241 803 651 443 033 330 031 441 033 330 031 653",
409 409
	"Anaconda [2]: 163 881 484 883 381 881 484 883 383 161 013 671 330 673 441 671 330 673 443 161 804 330 763 441 761 443 330 804 163 011",
410 410
	"Double Anaconda [1]: 803 331 161 333 811 163 653 171 483 651 481 013 031 563 673 561 273 671 241 913 351 243 353 881",
......
414 414
	"Double Python [1]: 164 653 013 483 813 161 803 171 333 651 011 804 880 033 673 351 273 881 243 911 561 031 671 240",
415 415
	"Double Python [2]: 010 803 163 333 813 011 653 171 483 801 161 650 670 243 883 561 273 671 033 911 351 241 881 030",
416 416
	"2 Spirals: 883 401 023 403 161 401 021 403 163 483 081 361 083 481 081 363 083 883 350 240 350 240 350 240 880 030 660 560 660 560 660 030 360",
417
	"Viper: 163 721 484 723 461 721 484 723 463 162 403 013 481 011 401 013 483 171 163 343 043 481 041 341 043 483 201 241 563 670 561 721 563 670 561 723 243",
418
	"Viper (Backside): 673 023 351 240 353 021 351 240 353 671 691 333 683 401 681 331 683 403 653 811 333 803 341 801 331 803 343 652 463 023 330 021 461 023 330 021 653",
419
	"Dodecahelix: 483 084 684 084 684 481 033 880 030 363 031 360 031 880 030 363 032 563 241 340 243 561 043 671 033 724 031 913 033 660 031 881 041 351 241 404 243 353 033",
417
	"Viper: 163 721 484 723 461 721 484 723 463 403 013 481 011 401 013 483 171 163 343 043 481 041 341 043 483 201 241 563 670 561 721 563 670 561 723 243",
418
	"Viper (Backside): 673 023 351 240 353 021 351 240 353 671 691 333 683 401 681 331 683 403 653 811 333 803 341 801 331 803 343 463 023 330 021 461 023 330 021 653",
419
	"Dodecahelix: 483 084 684 084 684 481 033 880 030 363 031 360 031 880 030 363 563 241 340 243 561 043 671 033 724 031 913 033 660 031 881 041 351 241 404 243 353 033",
420 420
	"Clover: 660 020 684 084 684 044 724 340 044 684 340 684 651 043 360 743 360 741 041 653",
421 421
	"2 Double Loops: 333 780 164 780 164 511 044 880 044 880 563 084 740 084 740",
422 422
    "Multi Snakes",

Also available in: Unified diff