SEC-S20W2 - How to Prepare Yourself for Programming?

in Steem For Bangladesh2 days ago (edited)

1000024590.jpgPicture Source

Preparing Yourself for Programming?


(1,0)

I repeat the question from the last lesson - "What should you have done before to become a programmer in the future?" who answered last time - +1auto

When this question was brought up last week, i suggested that preparing once self by developing the mindset of a programmer, which included critical thinking and problem solving.
I wish I had included solving diffrent kind of puzzels and playing games that develop our thinking ability and problem solving skills.

(1,0)

Name such game or logic puzzle that can prepare us for programming and explain how it can help a future programmer.

Playing games like mastermind is great for developing a programmers mindset. In incluse the use use of pegs and a code which has to be guessed correctly within a limited number of attempts. This game will help a person analyse feedback and isolate issues.

Another game that can greatly affect our becoming a successful programmer in the future is solving logic gdid puzzles which will help the person develop deductive reasoning and analytical skills

Sudoku is a Japanese game that can help you recognise patterns, develop logical reasoning and problem solving skills as you try to fill in the missing numbers following the rules of the game.

Solving scrabbled Rubik's cubes is another way we could get ready for programming. It helps us develop the ability to break complex problems into smaller chunks and also develop our ability to recognize symmetry and patterns.

(0,2)

I think that many people know the classic problem about a wolf, a goat and a cabbage. Where a man has to transport them all in a boat to the other shore, provided that he can take only one thing in the boat. And you can't leave them alone without a man, because he will eat the cabbage, and the wolf will eat the goat.

Solution
To solve this dilemma, the man will have to carry the goat to the other side. Living the wolf and cabbage behind.(wolves dont eat cabbage).
Then he will drop the goat at the other side and will come back and carry the wolf to cross. But when he gets there, he will, drop the wolf and carry the goat bach with him, living the wolf alone.
On geting back here, he will drop the goat and carry the cabbage to the other side because the wolf dont eat cabbage,
After dropping the cabbage with the wolf, he will travel back all alone to finally carry the goat.

(0,2)

Another problem of this type:
A couple of men who wanted to cross to the other side of the river approached the bank. They saw two boys nearby who were happily swimming in a boat. The men decided to ask the boys to help them cross, but it turned out that the boat was very small. He could handle either two boys at once, or just one adult.

Solution
We have boy 1 and 2. And to solve this problem, both boy 1 and 2 will cross to the other side and boy 2 will drop.
Boy 1 will come back with the boat to meet the men and will give the boat to one of the men who will use it to cross.
On getting to the other side, the man drops and boy 2 takes the boat back to meet boy one at the starting point. (One man has crossed).
It all loops again.
Both boy 1 and 2 will cross to the other side and boy 2 will drop.
Boy 1 will come back with the boat to meet the men and will give the boat to another one of the men who will use it to cross.
On getting to the other side, the man drops and boy 2 takes the boat back to meet boy one at the starting point. (Second man has crossed).
This will loop till all the men have crossed.

Solving problem 7 - 10 On the website https://blockly.games/ in the Maze section
The task must also be solved as best as possible, as efficiently as possible - think about it.

(blockly.games level 7)

1000024407.jpg


Solution code

swim(315);

This is my solution link for question 7
https://blockly.games/pond-tutor?lang=en&level=7#t6ktc6

(blockly.games level 8)

This opponent is too far away to use the cannon (which has a limit of 70 meters). Instead, use the 'swim' command to start swimming towards the opponent and crash into it.
swim(0);

1000024409.jpg


Solution Code

 swim(273);

This is my solution link for level 8
https://blockly.games/pond-tutor?lang=en&level=8#bjhj9v

(blockly.games level 9)

This opponent is also too far away to use the cannon. But you are too weak to survive a collision. Swim towards the opponent while your horizontal location is less than than 50. Then 'stop' and use the cannon.

1000024413.jpg


Solution code

  while (getX() < 50) {
     swim(0);
  }
  stop();
  while (50 == 50) {
    cannon(0, 45);
 }

This is my solution link for level 9
https://blockly.games/pond-tutor?lang=en&level=9#b4dhan

(blockly.games level 10)

This opponent will move away when it is hit. Swim towards it if it is out of range (70 meters)

1000024472.jpg


    while(true)
    {
        if(scan(45)>=50){
      swim(45);
          }else{stop();
      }
      cannon(45,scan(45));
   }

This is my solution link for level 10
https://blockly.games/pond-tutor?lang=en&level=10#7bsdy7

Solving level 9 -12 of studio code.com

(Studio code: lesson 9)

You made it to the reef, now search for the Heart of the Sea ! Use the blue and red coral to reach the treasure chest

Solution

 repeatUntilGoal(function () {
   moveForward();
   ifStandingOn('blueCoralBlock', function () {
     turn("right");
   });
   ifStandingOn('redCoralBlock', function () {
     turn("left");
   });
 });

1000024551.jpg

(Studio code: lesson 10)

There is a squid hiding somewhere in this Ocean Monument, can you find it?

Solution

 repeatUntilGoal(function () {
   moveForward();
   ifStandingOn('seaLantern', function () {
     turn("right");
   });
 });

1000024555.jpg

(Studio code: lesson 11)

Build a wall of prismarine around the black concrete. This will activate the conduit and complete your challenge!

Solution

 repeatUntilConduit(function () {
   moveForward();
   placePrismarine();
   ifStandingOnLimit('seaLantern', function () {
    turn("right");
   });

1000024563.jpg

(Studio code: lesson 12)

Congratulations! The open aquatic world awaits you. Build a coral reef! A volcano! A shipwreck! It's up to you.

Solution

Imagine that the calculator only has the operation '+1'.
now on the scoreboard 0.
describe how to get 100 on the scoreboard.

Solution

0 +1
Repeat it 100 times

With the "+1" and "x2" operations available:

Solution

Getting 100 on the Scoreboard

Start with 0 on the scoreboard.
Press +1 to get 1.
Press x2 and you have 2.
Press x2 to get 4.
Press x2 again five more times to get 64
And press +1 34 times
This will give you 100


Blockly Game maze


Level 7

1000025051.jpg1000025053.jpg

https://blockly.games/maze?lang=en&level=7&&skin=0#6ihoz9


Level 8

1000025055.jpg1000025057.jpg

https://blockly.games/maze?lang=en&level=8&skin=0#8k63ij



#sec20w2sergeyk
#s20w1 #steemexclusive
#nigeria #programming
#club5050

Sort:  
 2 days ago 

Upvoted. Thank You for sending some of your rewards to @null. It will make Steem stronger.

Loading...

Coin Marketplace

STEEM 0.18
TRX 0.15
JST 0.029
BTC 63747.71
ETH 2543.33
USDT 1.00
SBD 2.66