% Script/Function Filename:uicontrol
%     ourFactorialGUI.m
% Purpose:
%     Enter the purpose of the function/file here
%
% Record of modifications:
%     Programmer(s): {Your Name}
%     Date Due: YYYY-MM-DD
%     Date Submitted: YYYY-MM-DD
%     References: ????
%     Help Received: ????
%
% Variables Used:
%     Enter the variables that you use here

n = randi( 8 ) - 1;
nSpace = uicontrol( 'style' , 'text' , 'units' , 'normalized' , ...
    'fontunits' , 'normalized' , 'fontsize' , 0.5 , 'fontname' , 'fixedwidth' , ...
    'string' , sprintf( '%d!' , n ) , 'position' , [ 0 0 0.5 1 ] );

nFactorial = findFactorial( n );
nFactorialSpace = uicontrol( 'style' , 'text' , 'units' , 'normalized' , ...
    'fontunits' , 'normalized' , 'fontsize' , 0.1 , 'fontname' , 'fixedwidth' , ...
    'string' , num2str( nFactorial ) , 'position' , [ 0.5 0 0.5 1 ] );

factorialSlider = uicontrol( 'style' , 'slider' , 'units' , 'normalized' , ...
    'min' , 0 , 'max' , 7 , 'value' , n , 'position' , ...
    [ 0 0 1 0.05 ] , 'sliderstep' , [ 1 / 8 2 / 8 ] );
addlistener( factorialSlider , 'ContinuousValueChange' , ...
    @ourFactorialListener );

set( 0 , 'UserData' , { nSpace nFactorialSpace } );