Cody

Problem 2733. Evil Number

Solution 1123589

Submitted on 15 Feb 2017 by mohammad z
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
x = 1; y_correct = false; assert(isequal(isevil(x),y_correct))

a = Columns 1 through 16 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 Columns 17 through 32 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 33 through 48 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 Columns 49 through 64 1 1 1 1 1 1 0 0 1 1 0 1 1 0 1 1 Columns 65 through 80 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 Columns 81 through 96 1 0 1 1 1 1 1 1 1 1 0 1 0 0 1 1 Columns 97 through 112 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 113 through 128 1 1 1 1 0 0 1 1 0 1 1 1 1 1 1 1 Columns 129 through 144 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 145 through 160 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 161 through 176 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 177 through 192 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 193 through 208 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 209 through 224 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 225 through 240 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 241 through 256 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 257 through 272 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 273 through 288 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 289 through 304 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 305 through 320 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 321 through 336 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 337 through 352 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 353 through 368 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 369 through 384 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 385 through 400 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 401 through 416 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 417 through 432 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 433 through 448 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 449 through 464 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 465 through 480 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 481 through 496 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 497 through 512 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 513 through 528 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 529 through 544 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 545 through 560 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 561 through 576 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 577 through 592 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 593 through 608 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 609 through 624 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 625 through 640 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 641 through 656 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 657 through 672 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 673 through 688 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 689 through 704 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 705 through 720 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 721 through 736 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 737 through 752 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 753 through 768 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 769 through 784 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 785 through 800 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 801 through 816 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 817 through 832 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 833 through 848 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 849 through 864 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 865 through 880 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 881 through 896 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 897 through 912 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 913 through 928 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 929 through 944 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 945 through 960 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 961 through 976 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 977 through 992 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 993 through 1008 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 1009 through 1024 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Column 1025 1 tf = 0

2   Pass
x = 3; y_correct = true; assert(isequal(isevil(x),y_correct))

a = Columns 1 through 16 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 Columns 17 through 32 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 33 through 48 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 Columns 49 through 64 1 1 1 1 1 1 0 0 1 1 0 1 1 0 1 1 Columns 65 through 80 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 Columns 81 through 96 1 0 1 1 1 1 1 1 1 1 0 1 0 0 1 1 Columns 97 through 112 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 113 through 128 1 1 1 1 0 0 1 1 0 1 1 1 1 1 1 1 Columns 129 through 144 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 145 through 160 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 161 through 176 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 177 through 192 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 193 through 208 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 209 through 224 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 225 through 240 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 241 through 256 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 257 through 272 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 273 through 288 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 289 through 304 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 305 through 320 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 321 through 336 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 337 through 352 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 353 through 368 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 369 through 384 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 385 through 400 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 401 through 416 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 417 through 432 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 433 through 448 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 449 through 464 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 465 through 480 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 481 through 496 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 497 through 512 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 513 through 528 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 529 through 544 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 545 through 560 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 561 through 576 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 577 through 592 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 593 through 608 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 609 through 624 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 625 through 640 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 641 through 656 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 657 through 672 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 673 through 688 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 689 through 704 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 705 through 720 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 721 through 736 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 737 through 752 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 753 through 768 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 769 through 784 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 785 through 800 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 801 through 816 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 817 through 832 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 833 through 848 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 849 through 864 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 865 through 880 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 881 through 896 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 897 through 912 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 913 through 928 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 929 through 944 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 945 through 960 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 961 through 976 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 977 through 992 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 993 through 1008 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 1009 through 1024 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Column 1025 1 tf = 1

3   Pass
x = [18, 20, 23, 24, 27, 45, 46, 48, 96, 99, 123,]; y_correct = true; assert(isequal(all(arrayfun(@isevil,x)),y_correct))

a = Columns 1 through 16 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 Columns 17 through 32 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 33 through 48 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 Columns 49 through 64 1 1 1 1 1 1 0 0 1 1 0 1 1 0 1 1 Columns 65 through 80 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 Columns 81 through 96 1 0 1 1 1 1 1 1 1 1 0 1 0 0 1 1 Columns 97 through 112 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 113 through 128 1 1 1 1 0 0 1 1 0 1 1 1 1 1 1 1 Columns 129 through 144 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 145 through 160 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 161 through 176 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 177 through 192 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 193 through 208 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 209 through 224 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 225 through 240 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 241 through 256 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 257 through 272 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 273 through 288 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 289 through 304 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 305 through 320 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 321 through 336 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 337 through 352 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 353 through 368 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 369 through 384 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 385 through 400 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 401 through 416 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 417 through 432 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 433 through 448 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 449 through 464 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 465 through 480 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 481 through 496 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 497 through 512 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 513 through 528 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 529 through 544 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 545 through 560 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 561 through 576 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 577 through 592 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 593 through 608 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 609 through 624 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 625 through 640 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 641 through 656 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 657 through 672 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 673 through 688 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 689 through 704 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 705 through 720 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 721 through 736 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 737 through 752 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 753 through 768 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 769 through 784 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 785 through 800 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 801 through 816 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 817 through 832 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 833 through 848 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 849 through 864 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 865 through 880 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 881 through 896 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 897 through 912 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 913 through 928 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 929 through 944 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 945 through 960 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 961 through 976 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 977 through 992 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 993 through 1008 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 1009 through 1024 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Column 1025 1 tf = 1 a = Columns 1 through 16 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 Columns 17 through 32 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 33 through 48 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 Columns 49 through 64 1 1 1 1 1 1 0 0 1 1 0 1 1 0 1 1 Columns 65 through 80 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 Columns 81 through 96 1 0 1 1 1 1 1 1 1 1 0 1 0 0 1 1 Columns 97 through 112 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 113 through 128 1 1 1 1 0 0 1 1 0 1 1 1 1 1 1 1 Columns 129 through 144 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 145 through 160 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 161 through 176 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 177 through 192 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 193 through 208 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 209 through 224 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 225 through 240 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 241 through 256 1 1 1 1 1 1 1 1 1 1 1 1 ...

4   Pass
x = [14, 16, 19, 37, 38, 55, 56, 59, 62, 79, 82, 91, 93, 94, 97, 98, 117, 118, 121]; y_correct = false; assert(isequal(any(arrayfun(@isevil,x)),y_correct))

a = Columns 1 through 16 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 Columns 17 through 32 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 33 through 48 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 Columns 49 through 64 1 1 1 1 1 1 0 0 1 1 0 1 1 0 1 1 Columns 65 through 80 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 Columns 81 through 96 1 0 1 1 1 1 1 1 1 1 0 1 0 0 1 1 Columns 97 through 112 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 113 through 128 1 1 1 1 0 0 1 1 0 1 1 1 1 1 1 1 Columns 129 through 144 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 145 through 160 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 161 through 176 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 177 through 192 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 193 through 208 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 209 through 224 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 225 through 240 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 241 through 256 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 257 through 272 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 273 through 288 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 289 through 304 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 305 through 320 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 321 through 336 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 337 through 352 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 353 through 368 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 369 through 384 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 385 through 400 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 401 through 416 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 417 through 432 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 433 through 448 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 449 through 464 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 465 through 480 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 481 through 496 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 497 through 512 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 513 through 528 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 529 through 544 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 545 through 560 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 561 through 576 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 577 through 592 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 593 through 608 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 609 through 624 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 625 through 640 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 641 through 656 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 657 through 672 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 673 through 688 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 689 through 704 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 705 through 720 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 721 through 736 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 737 through 752 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 753 through 768 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 769 through 784 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 785 through 800 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 801 through 816 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 817 through 832 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 833 through 848 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 849 through 864 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 865 through 880 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 881 through 896 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 897 through 912 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 913 through 928 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 929 through 944 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 945 through 960 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 961 through 976 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 977 through 992 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 993 through 1008 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 1009 through 1024 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Column 1025 1 tf = 0 a = Columns 1 through 16 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 Columns 17 through 32 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 33 through 48 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 Columns 49 through 64 1 1 1 1 1 1 0 0 1 1 0 1 1 0 1 1 Columns 65 through 80 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 Columns 81 through 96 1 0 1 1 1 1 1 1 1 1 0 1 0 0 1 1 Columns 97 through 112 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 113 through 128 1 1 1 1 0 0 1 1 0 1 1 1 1 1 1 1 Columns 129 through 144 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 145 through 160 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 161 through 176 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 177 through 192 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 193 through 208 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 209 through 224 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 225 through 240 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 241 through 256 1 1 1 1 1 1 1 1 1 1 1 1 ...

5   Pass
x = 2^randi([5 10])+1; y_correct = true; assert(isequal(isevil(x),y_correct))

a = Columns 1 through 16 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 Columns 17 through 32 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 33 through 48 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 Columns 49 through 64 1 1 1 1 1 1 0 0 1 1 0 1 1 0 1 1 Columns 65 through 80 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 Columns 81 through 96 1 0 1 1 1 1 1 1 1 1 0 1 0 0 1 1 Columns 97 through 112 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 113 through 128 1 1 1 1 0 0 1 1 0 1 1 1 1 1 1 1 Columns 129 through 144 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 145 through 160 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 161 through 176 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 177 through 192 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 193 through 208 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 209 through 224 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 225 through 240 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 241 through 256 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 257 through 272 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 273 through 288 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 289 through 304 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 305 through 320 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 321 through 336 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 337 through 352 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 353 through 368 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 369 through 384 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 385 through 400 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 401 through 416 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 417 through 432 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 433 through 448 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 449 through 464 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 465 through 480 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 481 through 496 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 497 through 512 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 513 through 528 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 529 through 544 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 545 through 560 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 561 through 576 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 577 through 592 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 593 through 608 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 609 through 624 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 625 through 640 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 641 through 656 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 657 through 672 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 673 through 688 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 689 through 704 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 705 through 720 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 721 through 736 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 737 through 752 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 753 through 768 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 769 through 784 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 785 through 800 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 801 through 816 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 817 through 832 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 833 through 848 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 849 through 864 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 865 through 880 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 881 through 896 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 897 through 912 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 913 through 928 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 929 through 944 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 945 through 960 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 961 through 976 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 977 through 992 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 993 through 1008 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns 1009 through 1024 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Column 1025 1 tf = 1

6   Pass
% more test cases may be introduced

7   Pass
% DISABLED % ________'FAIR'_SCORING_SYSTEM______________ % % This section scores for usage of ans % and strings, which are common methods % to reduce cody size of solution. % Here, strings are threated like vectors. % Please do not hack it, as this problem % is not mentioned to be a hacking problem. % try % disable: assert(false) % size_old = feval(@evalin,'caller','score'); % all_nodes = mtree('isevil.m','-file'); str_nodes = mtfind(all_nodes,'Kind','STRING'); eq_nodes = mtfind(all_nodes,'Kind','EQUALS'); print_nodes = mtfind(all_nodes,'Kind','PRINT'); expr_nodes = mtfind(all_nodes,'Kind','EXPR'); % size = count(all_nodes) ... +sum(str_nodes.nodesize-1) ... +2*(count(expr_nodes) ... +count(print_nodes) ... -count(eq_nodes)); % feval(@assignin,'caller','score',size); % fprintf('Size in standard cody scoring is %i.\n',size_old); fprintf('Here it is %i.\n',size); end % %_________RESULT_____________________________

Suggested Problems

More from this Author41

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!