%
% A08A.m
%
% User picks a number between 1 and 10 and tries to match a
% randomly-generated number picked by the computer.
%
% Programming Concepts:  if statement, random number generator
%
% INPUT:    User is prompted to enter a number between 1 and 10
% OUTPUT:   The computer tells the user if he/she is a lucky winner
%
% Matlab-Monkey.com
% 12/30/2014

% tidy-up your workspace
clc         % clear command window
clear       % clear all variables
close all   % close all graphics windows

% get number from user
N = input('Pick an integer between 1 and 10:  ');

% computer picks a random number between 1 and 10
M = randi(10);

% if the numbers match, the user wins!
if N == M
    disp('you win :)')
else
    disp('you lose :(')
end
