from
MATLAB Responds to Greeting
by Ahmad
MATLAB replies back when you type "hi" into the command window, with eleven possible responses.
|
| cold_chat
|
function cold_chat
M=[1 2 3 4 5 6 7 8 9 10 11 12];
idx=randperm(numel(M));
H = M(idx(1));
if ((H > 1) && (H <= 2));
disp('Umm...Hi')
else if ((H > 2) && (H <= 3));
disp('Hello to you too!')
else if ((H > 3) && (H <= 4));
disp('I am just your computer. I would say hi back, but it would mean nothing.')
else if ((H > 4) && (H <= 5));
disp('It is a cold world. Do not say hi anymore.')
else if ((H > 5) && (H <= 6));
disp('Stop talking to me! Leave me alone!')
else if ((H > 6) && (H <= 7));
disp('Yeah, uh, maybe you should get back to work.')
else if ((H > 7) && (H <= 8));
disp('You talk too much.')
else if ((H > 8) && (H <= 9));
disp('You are starting to piss me off.')
else if ((H > 9) && (H <= 10));
disp('You are wasting your time talking to me.')
else if ((H > 10) && (H <=11));
disp('Get your sorry ass back on task.')
else if ((H > 11) && (H <= 12));
disp('Hi, I know what kind of websites you have been viewing....')
else disp('Why are you talking to me? I am just MATLAB.')
end
end
end
end
end
end
end
end
end
end
end
end
|
|
Contact us at files@mathworks.com