Cody

Solution 744032

Submitted on 23 Sep 2015 by Jean-Marie Sainthillier
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
%% assert(isequal(str2rgb('y'),[1 1 0]))

Png;base64,ivborw0kggoaaaansuheugaaakkaaag3caiaaaavklaxaaafl0leqvr42u3vmq0aaazdspin3teogmmseerj2gdajxia4g0a4g0a4g0a4g0a4g0aebsaebsaebsaebsaebsa3gya3gya3gya3gya3gaatwgatwgatwgatwgatwhgbqdgbqdgbqdgbqdgbqb4gwb4gwb4gwb4gwb4gwdepgia3gya3gya3gya3gya3gaatwgatwgatwgatwgatwhgbqdgbqdgbqdgbqdgbqb4gwb4gwb4gwb4gwb4gwdebgdebgdebgdebgdeboc3ayc3ayc3ayc3ayc3aebtaobtaobtaobtaobtaobtahgbahgbahgbahgbahgban4gan4gan4gan4gan4gglcbglcbglcbglcbglcb4g0a4g0a4g0a4g0a4g0aebsaebsaebsaebsaebsa3gya3gya3gya3gya3gya3gaatwgatwgatwgatwgatwhgbqdgbqdgbqdgbqdgbqb4gwb4gwb4gwb4gwb4gwdebgdebgdebgdebgdeboc3ayc3ayc3ayc3ayc3aebtaobtaobtaobtaobtacaban4gan4gan4gan4gan4gglcbglcbglcbglcbglcb4g0a4g0a4g0a4g0a4g0aebsaebsaebsaebsaebsa3gya3gya3gya3gya3gaatwgatwgatwgatwgatwhgbsoa4g0a4g0a4g0a4g0a4g0aebsaebsaebsaebsaebsa3gya3gya3gya3gya3gaatwgatwgatwgatwgatwhgbqdgbqdgbqdgbqdgbqb4gwb4gwb4gwb4gwb4gwdebgdebgdebgdebgdebgdeboc3ayc3ayc3ayc3ayc3aebtaobtaobtaobtaobtahgbahgbahgbahgbahgban4gan4gan4gan4gan4gglcbglcbglcbglcbglcb4g0a4g0a4g0a4g0a4g0a4g0aebsaebsaebsaebsaebsa3gya3gya3gya3gya3gaatwgatwgatwgatwgatwhgbqdgbqdgbqdgbqdgbqb4gwb4gwb4gwb4gwb4gwdebgdebgdebgdebgdebgasaobtaobtaobtaobtaobtahgbahgbahgbahgbahgban4gan4gan4gan4gan4gglcbglcbglcbglcbglcb4g0a4g0a4g0a4g0a4g0aebsaebsaebsaebsaebsa3qycan4gan4gan4gan4gan4gglcbglcbglcbglcbglcb4g0a4g0a4g0a4g0a4g0aebsaebsaebsaebsaebsa3gya3gya3gya3gya3gaatwgatwgatwgatwgatwhgbqdgbqdgbqdgbqdgbqdgbqb4gwb4gwb4gwb4gwb4gwdebgdebgdebgdebgdeboc3ayc3ayc3ayc3ayc3aebtaobtaobtaobtaobtahgbahgbahgbahgbahgban4gan4gan4gan4gan4gan4gglcbglcbglcbglcbglcb4g0a4g0a4g0a4g0a4g0aebsaebsaebsaebsaebsa3gya3gya3gya3gya3gaatwgatwgatwgatwgatwhgbqdgbqdgbqdgbqdgbqagaqdebgdebgdebgdebgdeboc3ayc3ayc3ayc3ayc3aebtaobtaobtaobtaobtahgbahgbahgbahgbahgban4gan4gan4gan4gan4gglcbglcbglcbglcbglcb4g0qaobtaobtaobtaobtaobtahgbahgbahgbahgbahgban4gan4gan4gan4gan4gglcbglcbglcbglcbwhz69fy1pc1dvgaaaabjru5erkjggg=="}
2   Pass
%% assert(isequal(str2rgb('m'),[1 0 1]))

Png;base64,ivborw0kggoaaaansuheugaaakcaaag1caiaaab8k8cvaaafkkleqvr42u3vmq0aaazdspin3ahom1kygjxjuwd4iria4goa4goa4goa4goauboauboauboauboauboargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagdgagc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4ggksbgksbgksbgksbgksb4goa4goa4goa4goauboauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwhgagdgagdgagdgagdgagc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4ggkupaicraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4gosaobqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4ggksbgksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwhgagdgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubocrqqcaqwgaqwgaqwgaqwhgagdgagdgagdgagdgagc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraebqegdgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboauboargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksbgksb4goa4goa4goa4goauboauboauboauboauboargyargyargyargaaq6kagksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwhgahia4goa4goa4goa4goauboauboauboauboauboargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagdgagc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gafmhqq0tzjihwwkaaaaasuvork5cyii="}
3   Pass
%% assert(isequal(str2rgb('c'),[0 1 1]))

Awapwoaswm8szrevrd0kaaaaabjru5erkjggg=="}
4   Pass
%% assert(isequal(str2rgb('r'),[1 0 0]))

Qpaaafguleqvr42u3vqqkaaazespo3vek4cerbp+0kanzjaicfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bkasacanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzaegagj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqbiaicfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqb+bgcbhlr6nvukqatiaaaaaelftksuqmcc"}
5   Pass
%% assert(isequal(str2rgb('g'),[0 1 0]))

Qpaaafguleqvr42u3vqqkaaazespo3vek4cerbp60laozjaicfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bkasacanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzaegagj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqbiaicfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqb+bgcthrcrnvtqqleyaaaaaelftksuqmcc"}
6   Pass
%% assert(isequal(str2rgb('b'),[0 0 1]))

Ddgzlaaaaaelftksuqmcc"}
7   Pass
%% assert(isequal(str2rgb('w'),[1 1 1]))

Png;base64,ivborw0kggoaaaansuheugaaakcaaag1caiaaab8k8cvaaafjuleqvr42u3vmq0aaazdspin3alym9kq8iqfgc8iaqcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboauboargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4maqcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboauboargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4maqcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboauboargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4maqcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagbwaguanaogdp84aaaaaelftksuqmcc"}
8   Pass
%% assert(isequal(str2rgb('k'),[0 0 0]))

Maax7cbw4aaaaasuvork5cyii="}
9   Pass
%% assert(isequal(str2rgb('yellow'),[1 1 0]))

Awapwoatwn3djren50rvgaaaabjru5erkjggg=="}
10   Pass
%% assert(isequal(str2rgb('magenta'),[1 0 1]))

Png;base64,ivborw0kggoaaaansuheugaaakcaaag1caiaaab8k8cvaaafkkleqvr42u3vmq0aaazdspin3ahom1kygjxjuwd4iria4goa4goa4goa4goauboauboauboauboauboargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagdgagc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4ggksbgksbgksbgksbgksb4goa4goa4goa4goauboauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwhgagdgagdgagdgagdgagc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4ggkupaicraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4gosaobqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4ggksbgksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwhgagdgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubocrqqcaqwgaqwgaqwgaqwhgagdgagdgagdgagdgagc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraebqegdgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboauboargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksbgksb4goa4goa4goa4goauboauboauboauboauboargyargyargyargaaq6kagksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwhgahia4goa4goa4goa4goauboauboauboauboauboargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagdgagc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gafmhqq0tzjihwwkaaaaasuvork5cyii="}
11   Pass
%% assert(isequal(str2rgb('cyan'),[0 1 1]))

12   Pass
%% assert(isequal(str2rgb('red'),[1 0 0]))

13   Pass
%% assert(isequal(str2rgb('green'),[0 1 0]))

14   Pass
%% assert(isequal(str2rgb('blue'),[0 0 1]))

15   Pass
%% assert(isequal(str2rgb('white'),[1 1 1]))

16   Pass
%% assert(isequal(str2rgb('black'),[0 0 0]))

17   Pass
%% assert(isequal(str2rgb('y'),[1 1 0]))

18   Pass
%% assert(isequal(str2rgb('m'),[1 0 1]))

19   Pass
%% assert(isequal(str2rgb('c'),[0 1 1]))

20   Pass
%% assert(isequal(str2rgb('r'),[1 0 0]))

21   Pass
%% assert(isequal(str2rgb('g'),[0 1 0]))

22   Pass
%% assert(isequal(str2rgb('b'),[0 0 1]))

23   Pass
%% assert(isequal(str2rgb('w'),[1 1 1]))

24   Pass
%% str = 'adefhijlnopqstuvxz'; for ii=1:length(str) assert(isequal(str2rgb(str(ii)),[])) end

25   Pass
%% assert(isequal(str2rgb('cyanide'),[]))

26   Pass
%% assert(isequal(str2rgb('yellowfin tuna'),[]))

27   Pass
%% assert(isequal(str2rgb('blue jays'),[]))