Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clc
- clear
- %% prob1
- age = input('how old you?');
- if age > 0 & age < 11
- fprintf('You are %.0f years old? That means you are a child \n',age)
- elseif age > 12 & age < 19
- fprintf('You are %.0f years old? That means you are a teen \n',age)
- elseif age > 20 & age < 65
- fprintf('You are %.0f years old? That means you are an adult \n',age)
- else age > 66
- fprintf('You are %.0f years old? That means you are an old geezer \n',age)
- end
- fprintf('\n')
- clear
- %% prob2
- a = input('Would you like to begin your adventure? Y/N ', 's');
- while (a == 'Y' ) | (a == 'y')
- x = randi([1 4],[1,1]);
- Q = {'take the L, simp','you a dead guy','james got too close to CAS and pulled yo ass','WASTED'};
- disp(Q(x))
- a = input('Would you like to start again? Y/N ', 's');
- end
- %% prob3
- a = input('Would you like to roll? Y/N ', 's');
- fprintf('\n')
- while (a == 'Y' ) | (a == 'y')
- d = randi([1,6],[1,2]);
- fprintf('time stands still as you stare daggers at house and house stares back.\n the sweat glistens on Houses brow.\n your hands begin to rattle the die betwixt your figers.\n suddenly, both dice come tumbling onto the board!\n')
- fprintf('\n')
- if d(1) > d(2)
- fprintf('House rolled a %.0f and won :(',d(2))
- elseif d(1) == d(2)
- fprintf('\n')
- disp('Victory hangs in the balance of randi')
- else
- fprintf('You remain triumphant...')
- end
- a = input('Would you like to roll again? Y/N' , 's');
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement