SEC-S20W2 - How to Prepare Yourself for Programming?
Hello Everyone
I'm AhsanSharif From Pakistan
Greetings you all, hope you all are well and enjoying a happy moment of life with steem. I'm also good Alhamdulillah. |
---|
Made in Canva
What should you have done before to become a programmer in the future? |
---|
Before becoming a programmer we have to consider some basic steps. Naturally, you have to follow these paths so that even if you haven't consciously thought of becoming a programmer yet, you can still succeed in your programming with these experiences.
We have to engage in critical thinking through which we solve puzzles, solve math problems, or solve any strategy-based games thus we acquire an important skill in programming. We will learn to look at problems in a way that we can engage in whatever we do. Like why not fix something in the house? This way you will be prepared for the logical step-by-step thinking required in coding.
Before starting programming, you must have wondered how technology works. Whether it's a smartphone a computer or software, your familiarity with how the app and system works gives you the basics of the digital world. So you should get experience with technology as it increases your technological curiosity.
You have to be curious about the world. You have to observe all the things around you and how they work. Be it science or mechanics or any system. These things will prepare you for curiosity in programming. You must accept opportunities to learn all skills or knowledge even before programming. Be it any school subject or any activity, this way you need constant adaptation and education in programming is fulfilled.
In programming, you have to think about logical things so you have to strengthen your roots in mathematics so that in programming you learn algebraic logic and problem-solving in basic mathematics. And thus you have to solve everyday problems with mathematical analytical thinking. This makes your base code easier to write and understand.
Logic games must be solved like chess 7 sudoku etc. or any video game that has a specific strategy and the solution is immediately followed. This can help build the logical thinking skills needed in programming. We were supposed to participate in team competitions and debates to engage in which developed our ability to defend our ideas and articulate concepts. Essential for programmers working in teams.
We have to face our problems with this determination. Before becoming a programmer we have to make ourselves determined to deal with difficulties. And we have to learn from them because the first thing we have to do in programming is tolerance. Because we also do code debugging and troubleshooting. So we have to develop flexibility in this situation and this flexibility is an important skill.
We have to develop our creativity before starting programming. For this, we have to engage in drawing, writing, or such activities. Thus, our creativity is valuable in programming when you are creating new software or creating state-of-the-art problems. And so we must have a mindset of improving performance from our process so that we have the skills to run the code in a good way.
We have the freedom to do our work whether it's our school assignments or any personal projects because it makes us strong enough to manage projects alone in programming. Likewise, teamwork experiences in sports group assignments or other collaborative activities will help us build the communication and coordination skills that are so important when working in programming teams.
Name a famous one before or find some simple online game (logic or puzzle). |
---|
A popular logic or puzzle game that can help future programmers is called Portal. It is a popular puzzle platform game. In this game, players use a single device to create two portals. that allows objects and characters to move through space in creative and mind-bending ways. It teaches us skills that are very important for programming.
How Portal can help future programming.
Problem Solving and Logic:
Each level in Portal has a new puzzle that requires a lot of thinking to solve, so players must analyze the environment to figure out how objects interact with each other. Thus it helps us to develop logical thinking for programming.
Creative Thinking:
Most of the puzzles in Portal require non-linear thinking and this is because players have to think outside the box to solve them. Because it is very important in programming. Especially when optimizing the code or coming up with innovative solutions to difficult problems.
Understanding Cause and Effect:
In any game, a player quickly learns how his actions are affecting the environment. For example, creating a portal in one place will affect where you or something exists. This is important because it often helps programmers understand cause and effect, which is important when debugging or writing code. Because one line of code can destroy your entire program.
Debugging Mindset:
Players often come up with different solutions in the portal, some of which fail. It teaches us perseverance. Similarly, in programming, you need to debug the code again and again to find the right solution.
Spatial Awareness and Algorithm:
As a player interacts with the portal he develops a sense of spatial awareness and sees how objects move in space. Thus it helps to understand the algorithm. Because programmers also often develop an algorithm to create something that makes them easier to program.
Example:
In Portal, you imagine that you need to move a block in a room to hit a button that will place the portal in the correct place. You will try in one place first but the blocks will be reduced. That's why you'll adapt your strategy by looking at programs that just don't work. You will use this approach using your strategy to test the code until it is fixed or works properly.
Wolf-goat-cabbage, First Puzzle |
---|
A farmer has to cross that river but he can take only one thing with him at a time to cross that river. Here's how to fix it.
- First the farmer will take the goat with him and leave it on the other side of the river.
- Then after leaving the Goat there, he will now return to his original side.
- Now he will take the wolf with him and leave him on the other bank, but there he cannot leave the goat for fear that the wolf will eat the goat.
- Then he will pick up the goat release the wolf and return to his original side.
- Now from here he will release the goat and take the cabbage with him and leave it on the other bank.
- After dropping Cabbage there, he will return to his original side.
- In the last step he will now take the goat with him and reach the other side of the river.
Thus it will carry all three objects to the other side of the river. And with its help, no one will eat anyone. He safely carries all three objects to the other side.
Two Men and Two Boys with a Boat: Second Puzzle |
---|
Using this puzzle we have to get two men and two boys across the river. But the boat is small, we can only carry two boys or one adult at a time. Here's how to fix it.
- The first step would be for the two boys to get into the boat and reach the other side.
- Now one boy will remain on this edge and the other boy will go back to the original edge.
- Now from here a person will go to the other side where a boy is already standing.
Now at this time, there is one boy and one man on both sides.
- Now a boy from the other side will come back to the original edge.
- Now both the boys will sit from the original side and go to the other side.
- On the other side, one boy will stop there and the other boy will return to his original place again.
- Now a person standing from the original side will reach his other side on this boat.
- The boy on the other side will now return to his original position.
Now in this position, there are two boys on the original side and two men are standing on the other side.
- Now both the boys will again reach the other side from their original position.
In this way, both the boys and the two men will easily reach the other side without any harm.
Two men and one boat |
---|
Here it is proved that both people are standing on opposite sides. Their solution is as follows.
- The first person will take the boat to the other side where the second person is already standing.
- The first person moves the boat to the other side where the second person is standing and they meet.
- Now the second person will take the boat back to the other side from where the first person started.
In this way, both people can be transported to their destination by boat.
Solve the last three and share in your post. If 8, 9, and 10 do not work, solve 7, 8, and 9. |
---|
Level 08:
Link To Solution
Here is the code
if (isPathForward()) {
moveForward();
}
if (isPathLeft()) {
turnLeft();
}
if (isPathRight()) {
turnRight();
}
}
Level 09:
Link To Solution
Here is the code
while (notDone()) {
moveForward();
if (isPathForward()) {
moveForward();
} else {
if (isPathLeft()) {
turnLeft();
} else {
turnRight();
}
}
}
Level 10:
Link To Solution
Here is the code
moveForward();
moveForward();
turnLeft();
moveForward();
while (notDone()) {
if (isPathRight()) {
turnRight();
}
if (isPathForward()) {
moveForward();
} else {
turnLeft();
}
}
Solve the last three and share in your post. If 8, 9, and 10 do not work, solve 7, 8, and 9. |
---|
Level 09
Screenshot From Minecraft
Here is the code
moveForward();
ifStandingOn('blueCoralBlock', function () {
turn("right");
});
ifStandingOn('redCoralBlock', function () {
turn("left");
});
});
Level 10
Screenshot From Minecraft
Here is the code
moveForward();
ifStandingOn('seaLantern', function () {
turn("right");
});
});
Level 11
Screenshot From Minecraft
Here is the code
moveForward();
placePrismarine();
ifStandingOnLimit('seaLantern', function () {
turn("right");
});
});
Level 12
I drew my second name first later S because it is difficult to draw my first name later A.
Screenshot From Minecraft
Here is the code
moveForward();
turn("left");
for (var count = 0; count < 2; count++) {
placeBlock("blueCoralBlock");
moveForward();
}
placeBlock("blueCoralBlock");
turn("left");
moveForward();
placeBlock("blueCoralBlock");
moveForward();
turn("left");
for (var count2 = 0; count2 < 2; count2++) {
placeBlock("blueCoralBlock");
moveForward();
}
placeBlock("blueCoralBlock");
turn("right");
for (var count3 = 0; count3 < 2; count3++) {
placeBlock("blueCoralBlock");
moveForward();
}
turn("right");
for (var count4 = 0; count4 < 2; count4++) {
placeBlock("blueCoralBlock");
moveForward();
}
placeBlock("blueCoralBlock");
moveForward();
Here is the achievement board
Did you learn to code? |
---|
First Scenario: Operation +1
If there is only one operation on a calculator and that too is OnePlus then we have to make it 100 on our scoreboard then we will have the following method for that.
We will press the plus one button 100 times so that our scoreboard reads 100 so we will start from zero. The first step will be our zero. In the second step, we have to do plus one. And so we have to do that plus one 100 times and then our scoreboard will be 100.
Start at 0
Press +1 100 times to get to 100
Second Scenario: Operation +1 and x2
In this scenario, we have an addition operation in which we have to multiply x2
. For this process first, we have to start from zero and add +1
. When we add, our answer will come 1
. Then we will multiply that by two, our answer 2
. Then multiply two by two and you will get 4
. Then if you multiply four by two, it will come up 8
. Multiplying eight will give 16
from two. Then multiply 16 by two and get 32
. When we get 32, we must add +1
18 times. When we add it 18 times, we answer 50
. And then we'll multiply 50 by two and our answer will be 100
.
Start at 0
Press +1 to get 1
From 1 press x2 to get 2
Press x2 again to get 4
Press x2 again to get 8
Press x2 again to get 16
Press x2 again to get 32
Press +1, 18 times to get 50
Press x2 to get 100
Find something similar to code.org and blockly.games. Write about it, solve three problems from there |
---|
Here I found https://runmarco.com/ similar to code.org or blockly game. I solve the first 14 levels. But here I show you 9, 10, 11, and 12.
Screenshot from https://runmarco.com/
Level 09:
Screenshot from https://runmarco.com/
Level 10:
Screenshot from https://runmarco.com/
Level 11:
Screenshot from https://runmarco.com/
Level 12:
Screenshot from https://runmarco.com/
Thank you so much for staying here. I invite my friends @rumaisha, @nahela, and @ruthjoe to participate in the challenge.
Cc:
@sergeyk
X:
https://x.com/AhsanGu58401302/status/1837890320740372875