%%                                     lecture 5
%

% Bedingte Verzweigungen

% Spiel


% neu: input, disp, return

x = fix(100*rand);

y=-1;

while y ~=x
    y = input('guess a number ')
    if y > x 
        disp('too large')
    elseif y<x
         disp('too small')
     else
         disp('Congratulation')
     end
 end
 
 
% Bsp Würfeln
% throw a dice until 6 has occurred 4 times

six = 0;
number = 0;
while six < 4
    number = number +1;
    eyes = 1+fix(6*rand);   % throw the dice
    if eyes == 6            % read the eyes of the dice
        six = six +1;
    end
end

return