0003-JS-WHJ-PRO-C7: VEGETABLE GARDEN - 2



PRO-C7: VEGETABLE GARDEN - 2




Story
Richard is a hardworking and dedicated farmer. He is always experimenting with new farming methods and now he wants to grow new crops on his farm.

Help Richard plan which plants to grow in which row. Here is what the scientist from the Agriculture Institute in his country has told him.
  • Tomatoes should not be planted next to Carrots.
  • Brinjals should not be planted next to Onions.
  • Carrots should not be planted next to Onions.
  • Tomatoes should not be planted next to Brinjals.
  • Capsicums can be grown next to any other plant.


Getting Started:
  1. Login to code.org
  2. Click on the following link: Project Template
  3. Click on “View Code”.
  4. Click on “Remix”
  5. Rename the project to Project 7 and click on Save.
Specific Tasks to complete the Project:
  1. When you start the project, you would be presented with an empty screen.
  2. Set the background color to brown.
  3. You have to grow rows of vegetables for Richard.
  4. Create 5 rows of different vegetables and there should be one type of vegetable per row.
  5. Create the rows according to the rules below:
    • Tomatoes should not be planted next to Carrots.
    • Brinjals should not be planted next to Onions.
    • Onions should not be planted next to Carrots.
    • Tomatoes should not be planted next to Brinjals.
  6. Use the images from the animation tab to put the vegetable in its correct row.
  7. Click on "Run" once to check if the code is working.

Hints:
  1. 1. Use the setAnimation() code to assign an image to a sprite.

 

Comments

Popular posts from this blog

0004-JS-WHJ-PRO-C8: THE WORLD’S HARDEST GAME

0000-JS-WHJ-PRO-C2: SQUARIADS

0001-JS-WHJ-PRO-C4: RETURN OF THE JEWEL THIEF