Javascript.RU

Создать новую тему Ответ
 
Опции темы Искать в теме
  #1 (permalink)  
Старый 28.04.2020, 22:58
Новичок на форуме
Отправить личное сообщение для Markus90 Посмотреть профиль Найти все сообщения от Markus90
 
Регистрация: 28.04.2020
Сообщений: 1

Помощь с решением задачи
Добрый день! Начал учить JS, столкнулся с нерешаемой для меня задачей на данный момент. Уже неделю ломаю голову как это сделать, прошу помочь.

Your task is to write a simple simulator of casino roulette.

Requirements:
Step 1:
• Create a prompt window (use confirm()). Show the message inside the window ‘Do you want to play a game?’.
• In case the user clicks the 'Cancel' button, the message 'You did not become a billionaire, but can.' should be shown (use alert).
Step 2:
• If user clicked ‘Ok’ – start a game: randomly (use Math.random()) choose an integer number in range [0; 5] (including 0 and 5) and ask user to enter a number of pocket on which the ball could land (use prompt()).
• User has 3 attempts to guess a number.
• If user guessed the number on which ball landed, on 1-st attempt prize is 100$ (maximum prize for current numbers range), 2-nd attempt – 50$, 3-rd attempt – 25$.
• If user did not guess a number show the message ‘Thank you for your participation. Your prize is: … $’ (Use alert) and ask if he wants to play again (use confirm).
Step 3:
• If user did guess - Show the message ‘Congratulation, you won! Your prize is: … $. Do you want to continue?’.
• If user does not want to continue – show the message ‘Thank you for your participation. Your prize is: … $’ (Use alert) and ask if he wants to play again (use confirm).
• If user does want to continue, make number range bigger at 5 as the previous one (for example [0; 5] -> [0; 10]), and two times bigger maximum prize (for example on 1-st attempt prize will be 200$, 2-nd attempt – 100$, 3-rd attempt – 50$). Prize must be added to the previous one and number of attempts should be set to 3 (user should have 3 attempts to guess a number for each numbers range)
• Each time you ask user to enter a number you should show him a range of cells, how much attempts he has left, his total prize and possible prize on current attempt.
Ответить с цитированием
  #2 (permalink)  
Старый 28.04.2020, 23:01
Профессор
Отправить личное сообщение для Nexus Посмотреть профиль Найти все сообщения от Nexus
 
Регистрация: 04.12.2012
Сообщений: 3,723

Сообщение от Markus90
Уже неделю ломаю голову как это сделать, прошу помочь.
Покажите код, который вы неделю писали.
Ответить с цитированием
Ответ



Опции темы Искать в теме
Искать в теме:

Расширенный поиск


Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Помогите с решением задачи katerina_tek1lka Общие вопросы Javascript 2 09.04.2017 09:57
Помогите с решением простой задачи пожалуйста Maolis Серверные языки и технологии 2 27.11.2014 17:29
Помощь с архитектурным решением damintsew Angular.js 2 07.04.2014 22:45
Нужна помощь в решении задачи jump91 Общие вопросы Javascript 1 23.05.2013 19:36
нужна помощь с решением задачи igsavenko Общие вопросы Javascript 6 30.04.2011 14:43