There is a Cities game. Its rules are: Cities are played by two or more people, each player, in turn, calls a real city of any country, the name of city begins with the letter that ends with the name of the previous player's city.
Let's implement this game. Let two people play
at one computer. They take turns. Cities are
entered in one input and sent by pressing the
Enter
key. The browser should remember
the cities that have already been, and not
accept such cities.
Let's immediately make a simple layout of our project. We will have an input for entering cities and div for displaying messages from the browser side:
<input id="field">
<div id="message"></div>
We can immediately obtain these elements into variables:
let field = document.querySelector('#field');
let message = document.querySelector('#message');
Let's talk now about the stages of this project implementation. In the previous lessons, I myself broke the project into stages, making it easier for you to work. In this project, I would like you to first try to do it yourself.
Write down the text of each of subtasks that need to be solved for the implementation of this project.