Problem 242. Make a function that returns its own character count

Solution 132786

Submitted on 30 Aug 2012 by Aurelien Queffurust
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
fname = 'omphaloskeptic.m'; fid = fopen(fname); file = textscan(fid,'%c', ... 'CommentStyle','%', ... 'Whitespace',''); fclose(fid); ha = histc(file{1},1:128); hp = omphaloskeptic; assert(~any(ismember(33:41,find(ha))),'Used an illegal character'); assert(isequal(ha,hp),'Actual characters did not match prediction');

jj = 1.2246e-16 jj = 0.8415 jj = 0.9093 jj = 0.1411 Cheating is a sin against which commandment? Once again Cheating is a sin against which commandment? no, you made the test suite to easy to hack?{Warning: Function /users/msssystem20/assert.m has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.} {> In omphaloskeptic at 20 In verifyCode>evaluateCode at 189 In verifyCode at 40 In fevalJSON at 14}