Hello, dear programmers! Help, please, write a program in javascript . She has the following wording: The number of steps is random. The height of each step is equal to the selected unit, and the width can vary randomly from 1 to 3. It is necessary to reproduce the ascent and descent of the steps, specifying the sequence of changes in the coordinates of a moving object that can take steps equal to the selected unit in the horizontal and vertical directions. Tell me where to start!

  • @niko, According to the rules of the forum, questions should not be reduced to the decision or the completion of student assignments. Please clarify what you have done yourself and what did not work out. - zb '
  • 2
    I understand you need something like this? jsfiddle.net/K9X5s - Zowie

1 answer 1

Start by building a program algorithm. Did you have the flowcharts there already?

  • Yes passed. I started to start with a random number generator? - niko
  • Something a little confusing condition. Do you have the program to determine the sequence by which the ascent and descent are possible or just to check the specified sequence? - Zhukov Roman
  • Most likely you need to make a sequence yourself and after checking it, the program will start to execute. How can I make a sequence? - niko
  • You need an array of objects of the form [{w: ..., h: ...}, {w: ..., h: ...}, {...}]; - Zowie