Cody

Solution 1706073

Submitted on 11 Jan 2019
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Pass
% Adapted from the code of Alfonso Nieto-Castanon in a comment at % https://www.mathworks.com/matlabcentral/cody/problems/44343 . assert(~any(cellfun(@(x)ismember(max([0,str2num(x)]),[120,165,220,286]),regexp(fileread('twelvetide.m'),'[\d\.\+\-\*\/]+','match'))), 'Please do not hard-code your ''solution''.') %assert(~any(cellfun(@(x)ismember(max([0,str2num(x)]),[120,165,220,286,364]),regexp(fileread('twelvetide.m'),'[\d\.\+\-\*\/]+','match'))), 'Please do not hard-code your ''solution''.') <-- prior to 2018-01-02. assert(~any(cellfun(@(x)ismember(max([0,str2num(x)]),[55,66,78]),regexp(fileread('twelvetide.m'),'[\d\.\+\-\*\/]+','match'))), 'No, really: please do not hard-code your ''solution''.') % Added on 2018-01-06.

2   Fail
day = 0 - randi(50); accumulatedGifts = 0; assert( isequal(twelvetide(day), accumulatedGifts) )

ans = 91

Output argument "accumulatedGifts" (and maybe others) not assigned during call to "twelvetide". Error in Test2 (line 3) assert( isequal(twelvetide(day), accumulatedGifts) )

3   Fail
day = 0; accumulatedGifts = 0; assert( isequal(twelvetide(day), accumulatedGifts) )

ans = 0

Output argument "accumulatedGifts" (and maybe others) not assigned during call to "twelvetide". Error in Test3 (line 3) assert( isequal(twelvetide(day), accumulatedGifts) )

4   Fail
day = 1; accumulatedGifts = 1; assert( isequal(twelvetide(day), accumulatedGifts) )

ans = 1

Output argument "accumulatedGifts" (and maybe others) not assigned during call to "twelvetide". Error in Test4 (line 3) assert( isequal(twelvetide(day), accumulatedGifts) )

5   Fail
day = 2; accumulatedGifts = 4; assert( isequal(twelvetide(day), accumulatedGifts) )

ans = 3

Output argument "accumulatedGifts" (and maybe others) not assigned during call to "twelvetide". Error in Test5 (line 3) assert( isequal(twelvetide(day), accumulatedGifts) )

6   Fail
day = 3; accumulatedGifts = 10; assert( isequal(twelvetide(day), accumulatedGifts) )

ans = 6

Output argument "accumulatedGifts" (and maybe others) not assigned during call to "twelvetide". Error in Test6 (line 3) assert( isequal(twelvetide(day), accumulatedGifts) )

7   Fail
day = 4; accumulatedGifts = 20; assert( isequal(twelvetide(day), accumulatedGifts) )

ans = 10

Output argument "accumulatedGifts" (and maybe others) not assigned during call to "twelvetide". Error in Test7 (line 3) assert( isequal(twelvetide(day), accumulatedGifts) )

8   Fail
day = 5; accumulatedGifts = 35; assert( isequal(twelvetide(day), accumulatedGifts) )

ans = 15

Output argument "accumulatedGifts" (and maybe others) not assigned during call to "twelvetide". Error in Test8 (line 3) assert( isequal(twelvetide(day), accumulatedGifts) )

9   Fail
day = 6; accumulatedGifts = 56; assert( isequal(twelvetide(day), accumulatedGifts) )

ans = 21

Output argument "accumulatedGifts" (and maybe others) not assigned during call to "twelvetide". Error in Test9 (line 3) assert( isequal(twelvetide(day), accumulatedGifts) )

10   Fail
day = 7; accumulatedGifts = 84; assert( isequal(twelvetide(day), accumulatedGifts) )

ans = 28

Output argument "accumulatedGifts" (and maybe others) not assigned during call to "twelvetide". Error in Test10 (line 3) assert( isequal(twelvetide(day), accumulatedGifts) )

11   Fail
day = 8; accumulatedGifts = 120; assert( isequal(twelvetide(day), accumulatedGifts) )

ans = 36

Output argument "accumulatedGifts" (and maybe others) not assigned during call to "twelvetide". Error in Test11 (line 3) assert( isequal(twelvetide(day), accumulatedGifts) )

12   Fail
day = 9; accumulatedGifts = 165; assert( isequal(twelvetide(day), accumulatedGifts) )

ans = 45

Output argument "accumulatedGifts" (and maybe others) not assigned during call to "twelvetide". Error in Test12 (line 3) assert( isequal(twelvetide(day), accumulatedGifts) )

13   Fail
day = 10; accumulatedGifts = 220; assert( isequal(twelvetide(day), accumulatedGifts) )

ans = 55

Output argument "accumulatedGifts" (and maybe others) not assigned during call to "twelvetide". Error in Test13 (line 3) assert( isequal(twelvetide(day), accumulatedGifts) )

14   Fail
day = 11; accumulatedGifts = 286; assert( isequal(twelvetide(day), accumulatedGifts) )

ans = 66

Output argument "accumulatedGifts" (and maybe others) not assigned during call to "twelvetide". Error in Test14 (line 3) assert( isequal(twelvetide(day), accumulatedGifts) )

15   Fail
day = 12; accumulatedGifts = 364; assert( isequal(twelvetide(day), accumulatedGifts) )

ans = 78

Output argument "accumulatedGifts" (and maybe others) not assigned during call to "twelvetide". Error in Test15 (line 3) assert( isequal(twelvetide(day), accumulatedGifts) )

16   Fail
day = 13; accumulatedGifts = 364; assert( isequal(twelvetide(day), accumulatedGifts) )

ans = 91

Output argument "accumulatedGifts" (and maybe others) not assigned during call to "twelvetide". Error in Test16 (line 3) assert( isequal(twelvetide(day), accumulatedGifts) )

17   Fail
day = 100; accumulatedGifts = 364; assert( isequal(twelvetide(day), accumulatedGifts) )

ans = 5050

Output argument "accumulatedGifts" (and maybe others) not assigned during call to "twelvetide". Error in Test17 (line 3) assert( isequal(twelvetide(day), accumulatedGifts) )

18   Fail
for i = 1 : 10 day = 12 + randi(300); accumulatedGifts = 364; assert( isequal(twelvetide(day), accumulatedGifts) ) end;

ans = 16471

Output argument "accumulatedGifts" (and maybe others) not assigned during call to "twelvetide". Error in Test18 (line 4) assert( isequal(twelvetide(day), accumulatedGifts) )