SEC-S20W2 - How to Prepare Yourself for Programming

in #sec20w2sergeyk6 months ago


1000317836.png
preparing for programming

Hi everyone!.

Greetings to you all and welcome to this week's engagement challenge. I'm so excited to have been active in the last lesson and this week I I'm even more excited to continue the learning process. Without wasting much time, I will proceed to the main details.



What should I have done before to become a programmer in the future?


Becoming a programmer is not a One day task and there are a lot of things we should have put in place before embarking on our journey of becoming programmers. Starting my journey. These are a few things I should have done before becoming a programmer.

1• Start learning to code early: it's much better to begin learning coding earlier. There are varieties of resources found online and in libraries to help you begin. We have popular programming languages for beginners Which are; Python, JavaScript, and Scratch.

2• Practice regularly: Coding is a skill that takes practice to master. Create time to code every day, even if it's just for a a little while. Visit more online coding challenges and projects that can help you work on to improve your skills.

3• Learn about different programming concepts: Programming involves understanding a variety of concepts, such as algorithms, data structures, and software development methodologies. You can learn about these concepts through by enrolling courses online, books, and practice tutorials.

4• Build a portfolio of your work: As you learn to code, start building a portfolio of your work. This will help you demonstrate your skills to potential employers. You can host your portfolio on a website or platform like GitHub which are easy to navigate.

5• Network with other programmers: connecting with other programmers is a better approach to learn new things and get feedback on your work. You can attend meetups, and online participate in coding competitions.

6• Consider a degree in computer science or a related field: While a degree is not a major necessity to become a programmer, it can give you a strong foundation in the field. This gives you the basis to begin on as your programming journey proceeds


Name a game known before or find some simple online game (logic or puzzle). Using it's example, explain how the game can help a future programmer


There are several of games which I could choose from, but the one which interests me the most is the Sudoku game. Sudoku is a popular logic puzzle game that can be a great tool for laying basic skills of a future programmer.

Here is how Sudoku Can Help a Future Programmer

  • Problem-solving: Sudoku requires players to use logic and deduction to solve puzzles. It is a the same fundamental skill programmers use when coding, who often face complex problems that require creative solutions.

  • Algorithmic thinking: Sudoku puzzle apply breaking down the problem into tiny steps and applying algorithms to derive the solution. This is in comparison to how programmers design and implement algorithms in their coding.

  • Attention to detail: Sudoku puzzles require players to pay close attention to the details of the grid and follow strictly the rules of the game. This is essential for programmers, who need to be more judgemental in their code to avoid errors.

  • Pattern recognition: Recognizing patterns is an important skill for both Sudoku players and programmers. In Sudoku, players look for patterns in the grid to spot out the potential solutions. In programming, recognizing patterns in code can help developers write more efficient and maintainable programs effectively.

A Simple Sudoku example explained:

1 3 5
2 4 6
7 8 9

In this 3x3 Sudoku puzzle scheme, the aim is to fill in the remaining squares with the numbers 1-9 so that each row, column, and 3x3 subgrid contains all of the numbers 1-9 must fit following the game rules.

1000318489.png1000318455.png

Starting.

1000318487.png1000318488.png

💯 Complete


The classic puzzle of the wolf, the goat, and the cabbage explained.


1000318491.png

This is such a complex puzzle, whereas to begin with, you will have to list the problem statement.

The Problem:

  • You have to transport a wolf, a goat, and a cabbage across a river to the other shore.

  • You can only take one item at a time in your boat.

  • Do not leave the wolf and goat alone, Because the wolf will eat the goat.

  • If you leave the goat and cabbage alone, the goat will eat the cabbage.

The Solution:

  • Take the goat to the other side: This is the only safe item to transport first, as neither the wolf nor the cabbage will harm it.

  • Return alone: Go back to the starting side without taking anything.

  • Take the cabbage to the other side: Now, the goat is safe on the other side, and you can bring the cabbage over.

  • Return with the goat: Bring the goat back to the starting side.

  • Take the wolf to the other side: The goat is now on the starting side, and the wolf can safely join it.

  • Return alone: Go back to the starting side.

  • Take the goat to the other side: Now, all three items are successfully transported to the other side without any unfortunate incidents.

Points to note:

  • Always return alone: This is crucial to ensure that no item is left alone with a potential predator.

  • Prioritize the goat: The goat is the most vulnerable item, so it's important to transport it first and last.


Two men and two boys with a boat puzzle Resolution:


Let's break down this puzzle in simple steps:

The Problem:

  • Two boys and two men have to cross a river.
  • The boat can only hold two boys or one adult at a time.
  • The goal is to get all four people to the other side.

The Solution:

  • Two boys cross: The two boys cross to the other side.

  • One boy returns: One boy rows back to the starting side.

  • One man crosses: The first man crosses to the other side.

  • One boy returns: The boy who crossed first rows back to the starting side.

  • Two boys cross:
    The remaining boy and the second man cross to the other side.

  • One boy returns: One of the boys rows back to the starting side.

  • One man crosses: The second man crosses to the other side.

  • Two boys cross: The two remaining boys cross to the other side.

Now, all four people have successfully crossed to the other side.

The key to note when solving this puzzle is to use the boys as "ferrymen" to transport the men back and forth. By carefully planning the crossings, the men can safely reach the other side.


Two men and one boat puzzle Resolution.


Here's how the two men crossed the river in the small boat:

  • #The first man crosses:* One of the men gets into the boat and rows across to the other side.

  • The first man returns: The first man rows back to the starting side.

  • The second man crosses: The second man gets into the boat and rows across to the other side.

  • The first man returns: The first man rows back to the starting side.

Now, both men have successfully crossed the river.

The key to solving this puzzle is to realize that the first man can act as a "ferryman" to transport the second man across. By making multiple crossings, they can both reach the other side without any additional help.


Blockly.games.


8

while (notDone()) {
  if (isPathForward()) {
    moveForward();
  }
  if (isPathLeft()) {
    turnLeft();
  }
  if (Ispathright()) {
   turnRight();
  }
}

1000318538.png
Link

9

while (notDone()) {
  moveForward();
  if (isPathForward()) {
    moveForward();
  } else {
    if (isPathLeft()) {
      turnLeft();
    } else {
      turnRight();
    }
  }

1000318539.png
link

10

moveForward();
moveForward();
turnLeft();
moveForward();
while (notDone()) {
  if (isPathRight()) {
    turnRight();
  }
  if (isPathForward()) {
    moveForward();
  } else {
    turnLeft();
  }
}

1000318540.png
Link

code.org: solve the last four stage and share in my post.

9

1000318599.png1000318607.png
Imagecode

10

1000318608.png1000318612.png

11

1000318613.png1000318647.png

12

1000318804.png
g)

1000318625.png1000318626.png

Completion certificate award

1000318627.png


From 0 to 100.


Getting to 100 with '+1' only
To reach 100 on the scoreboard starting from 0 using only the '+1' operation, we will need to press the '+1' button 100 times.

This is because each time you press '+1', the number on the scoreboard increases by 1.

Getting to 100 with '+1' and 'x2'

With the addition of the 'x2' operation, we can reach 100 much more quickly.

Here's a how:

  • Press '+1' 7 times. This will bring the score to 7.
  • Press 'x2'. This will double the score to 14.
  • Press 'x2' again. Now the score is 28.
  • Press 'x2' one more time. The score becomes 56.
  • Press '+1' 4 times. This brings the score to 60.
  • Press 'x2'. The final score is 120.

So, using '+1' and 'x2', you can reach 100 in fewer steps than using '+1' alone.


Find something similar to code.org and blockly.games


Rodocodo

This is nothing but a simple game which uses a cat to move from one place to another. The movement involved a pattern which the player must follow in order to reach the finish line. In this game, player is obliged to observe keenly and figure out a sequence in which he can use to make sure the cat gets to the finish line following the input sequence.

For this, the player will have to count the number of squares in which the cat has to move and put the footsteps in each Square. if the card has to move 3 Square for instance. The player will have to input three footprints.

You know programming is based on algorithm and following every algorithm is crucial to accomplish any given test. This game puts you in a programmer's mindset and make you complete one task at a time.

1:

1000318656.png

2:

1000318657.png

3:

1000318674.png

To conclude, I would like to invite a following persons. Join me participate in this contest. @wirngo, @simonnwigwe, @starrchris



Credit to; @rafk

Sort:  

You should be attentive and careful when completing tasks. Thank you for participating; this task was extensive, and the next one should be smaller in scope.

Task Comment Grade
1) What should you have done before to become a programmer in the future? I’ve already clarified the essence of my question — not "a few things I should have done before becoming a programmer.", but "what I should have done before I DECIDED to become a programmer." In other words, what I needed to learn/do back then when you weren’t thinking about being a programmer yet. 0.2/1
2) Name an online game (logic or puzzle). Explain how it can help the programmer. The answer to this question should actually follow from the response to the first one.
There are plenty of logical games—why do all students choose the same Sudoku that everyone else is doing? I didn't specify this restriction in the rules, but I will do so next time.
0.6/1
3.1) Wolf-goat-cabbage You explained the solution to the problem very well. 0.3/0.3
3.2) Two men and two boys with a boat 0.3/0.3
3.3) Two men and one boat Not at all correct. I only gave a grade for the attempt to solve it. The problem is very easy, but the solution is not in the direction you think because you believe it’s complex.
You write that one man swims there and then back, and the second one goes there and back — so how did they cross? They were just returning.
0.1/0.4
4) blockly.games The link to the solution for problem 8 is incorrect; it should have been generated after solving it. Perhaps you did it at the beginning of the solving process.
8, 9, and 10 are correct, but it’s always preferable to look for solutions that save something, like the number of teams or the steps of the performer.
1.7/2
5) code.org All is correct; the addition is the same as in the previous one: you should always look for the best solution. However, at the beginning of learning, any correct solution is acceptable. 2.7/3
6) From 0 to 100 You didn’t think much about the task, and you didn’t even notice that you solved it incorrectly. You were supposed to reach 100, but you reached 120. 0.2/1
7) like code.org та blockly.games The task required finding something similar to code.org and blockly.games. Since other students have already mentioned those, it would have been better to find something different. 0.7/1
Total: *** 6.8/10

@tipu curate

;) Holisss...

--
This is a manual curation from the @tipU Curation Project.

New to Steemit?