I am @hudamalik20 from Pakistan. How is everyone doing? I hope you’re all well and thriving in life. Today, I’m excited to participate in the SEC-S20W2 contest, "How to Prepare Yourself for Programming?" organized by @sergeyk. I’ll be sharing my thoughts on effective strategies for aspiring programmers. So, let’s start..🤗🌼🌸
1."What should you have done before to become a programmer in the future?"
When I first heard about programming, I was only told that it’s about learning computer languages and using them to make things. But nobody explained what programming really is, or how I should prepare myself before starting to learn it, or even if I could do it.
When I got to college, our teachers explained the rules of programming. That’s when I learned that programming isn’t just about learning different languages and writing code. It’s more about problem-solving and thinking logically. Before we even start coding, we need to figure out if we can solve problems in an organized way.
Our teacher told us that before programming, we need to work on our logical and algorithmic thinking. When we face a problem or need to create something, we have to first think of the best way to solve it step by step. We look at all the possible ways and choose the one that is the most effective, with fewer chances of errors or problems.
Our teacher also asked us how many of us liked playing puzzle games. Very few students said yes. Then, the teacher explained that games, especially those that need logic, help improve our thinking skills. For example, even in fighting games, you have to think logically about which path to choose and how to defeat the enemy. This is like a puzzle game for the brain.
At that time, I shared with the teacher that I was playing a brain game. In that game, every level gives a new puzzle to solve, and I had to think of every possible way to solve it. It made me feel active and kept my mind working. Similarly, in programming, we break problems into smaller pieces, and then we join those pieces together to complete the task.
We also need some basic math skills for programming. Not too much, but just a little understanding of math concepts, especially operators like plus, minus, multiply, and divide, which we learned in school.
Before starting programming, we also need to know some basic things about how computers work, like how to create files and use a computer properly. It’s also helpful to know keyboard shortcuts and folder shortcuts to save time and work faster.
2.Name a known before or find some simple online game (logic or puzzle). Using her example, explain how she can help a future programmer.
A few months ago, I started playing Brain Test, a puzzle game that challenges your logic and problem-solving skills. Whenever I have some free time, I dive into the levels, and it's a lot of fun! Sometimes, I play with my friends, and we help each other solve the tricky puzzles together.
Playing this game keeps my mind active and engaged. Each level presents a unique challenge, requiring me to think critically and creatively to find solutions.
This kind of logical thinking is essential for becoming a programmer. Just like in programming, where we face problems that need solving, Brain Test teaches us to break down challenges into smaller parts and approach them step by step.
I suggest everyone try this game! Each level covers different topics, ensuring our minds stay active. Sometimes it takes time to find the right solution, but that’s part of the fun. We learn to think carefully and explore all possible answers, which is great practice for our minds.
Although I had to delete the game due to low memory on my phone, I still miss it! I often think about downloading it again to complete more levels. The way it exercises my brain is something I value, especially as I prepare for a future in programming.
3.1: Wolf-goat-cabbage.
This is the problem we faced in our classroom. Our teacher presented a classic puzzle, and while many of my friends already knew how to solve it, I was confused and admitted I didn’t know the answer.
The problem involves transporting a wolf, a goat, and a cabbage across a river using a boat that can carry only one item at a time. Here’s how we solved it step by step:
Take the Goat Across: First, we took the goat across the river. This was important because the goat cannot be left alone with the cabbage, as it would eat it.
Return Alone: After dropping the goat on the other side, we returned alone to the starting point.
Take the Cabbage Across: Next, we took the cabbage across the river.
Bring the Goat Back: Since we couldn’t leave the goat with the cabbage, we brought the goat back to the starting side, leaving the cabbage safely on the other side.
Take the Wolf Across: Then, we took the wolf across the river to the other side where the cabbage was.
Return Alone Again: We returned alone to the starting side one last time.
Final Trip with the Goat: Finally, we took the goat across the river for the last time.
By following these steps, we successfully transported all three items without any of them being eaten. We were so happy to solve this puzzle, as it required careful planning and logical thinking to ensure that the goat and cabbage were never left alone together, and that the goat was never left alone with the wolf.
3.2: Two men and two boys with a boat
I found it interesting to solve. The challenge is to get everyone across using a boat that can only hold two people at a time, without leaving the boys alone with the men.
First, the two boys row across the river together. Now, the boys are on the other side while the two men remain on the starting side.
Next, one boy rows back alone to the starting side, so now we have one boy on the other side and one boy back with the two men.
Then, one of the men gets into the boat with the boy who is back on the starting side, and they row across together. Now, we have one man and one boy on the other side.
After that, the boy who just crossed rows back alone to the starting side, leaving one man on the other side.
Now, both men get into the boat and row across together. So now, we have both men and one boy on the other side.
Finally, the last boy rows back alone to the starting side and then takes the boat back across with the other boy.In the end, all four of them two men and two boys are safely across the river.
3.3: Two men and one boat .
After thinking about this puzzle for a long time, I decided to share it with my family to get their help. I was really stuck and tried many different ideas, but my mind couldn't figure out how the two boys could cross the river using just one boat. To help visualize it better, I even drew a little diagram in my notebook.
After about 35 minutes of brainstorming, my little sister said she would give it a try. She pointed out something important: the riddle doesn’t actually say that both boys start on the same side of the river.
This was a breakthrough. One boy could be on the left side while the other was on the right side. This meant that each boy could simply use the boat to cross from his own side without any complications.So ya it was a simple yet clever solution that opened my eyes I hope it's right🙂😁.
4.blockly.games
###Solving blocky.games Maze Puzzles (Levels 7 to 10)
While working on these maze puzzles, I had to apply my problem-solving skills and think logically to navigate through each level. I also received guidance from a close friend who’s very experienced in programming. Together, we tackled the different challenges these puzzles presented, and I’m really happy to share how I managed to solve them. Here's how I approached levels 7 to 10.
Level 7:
Level 7 introduced the idea of following a set path. I knew I had to move forward unless a better option appeared. After some trial and error, I figured out the best approach was to check for a right path and turn accordingly.
Here’s the code I used:
while (notDone()) {
if (isPathRight()) {
turnRight();
}
moveForward();
}
By keeping it simple and always checking for a right turn before moving forward, I managed to complete the level smoothly in just 6 lines of code. It felt great to see everything come together so neatly.
Level 8:
This level required me to check for both left and right paths. I quickly realized that to navigate efficiently, I needed to account for all available options before moving forward.
The solution I came up with:
while (notDone()) {
if (isPathLeft()) {
turnLeft();
}
if (isPathRight()) {
turnRight();
}
moveForward();
}
This time, I prioritized the left path first, and then checked for the right. By doing so, I ensured that I wouldn’t miss any opportunities to turn in the correct direction.
Level 9:
In level 9, to prioritize moving straight unless I couldn’t go forward anymore. If blocked, I would have to look for another path. After discussing different strategies with my friend, I realized that focusing on forward movement first would save me from making unnecessary turns.
Here’s what I wrote:
while (notDone()) {
if (isPathForward()) {
moveForward();
} else {
if (isPathLeft()) {
turnLeft();
}
moveForward();
}
}
This method ensured that I kept going straight as much as possible. When I hit an obstacle, I would check for a left turn and continue from there. It worked very effectively and helped me get through the level quickly.
Level 10:
Level 10 was definitely the most challenging. It required more checks and careful decision making, but by applying everything I had learned from previous levels, I was able to figure out the best approach.
Here’s the final solution:
while (notDone()) {
moveForward();
if (isPathForward()) {
if (isPathRight()) {
turnRight();
} else {
if (isPathLeft()) {
turnLeft();
}
}
} else {
if (isPathLeft()) {
turnLeft();
} else {
turnRight();
}
}
}
The moment I saw it working, I knew I had finally cracked the toughest maze. This level really pushed my thinking and taught me a lot about handling complex situations logically.
When I first started working, I had no idea how difficult they would be. At first, it seemed impossible to crack these puzzles. I struggled to figure out the correct sequence of blocks and had trouble with how the character was supposed to move in the maze.
With my friend’s advice, I was able to push through and solve level 6. Moving to level 10 felt like a small victory. It was still challenging, but now I knew better how to plan the steps. I learned to focus on the sequence of movements and how to place corals in the right positions. Step by step, I started gaining more confidence.
Level 7 brought another challenge. I got stuck for hours trying to figure out how to solve the maze efficiently. At this point, I took a break to clear my head, and then I tried again with a fresh mind. That made all the difference. After adjusting my approach, I finally cracked the level.
By the time I reached level 12, I was feeling more confident. I knew how to handle the movements and positioning better. Although this was still a tough one, I managed to get through it without asking for additional help. It was such a satisfying moment when I saw the puzzle work correctly for the first time!
6.From 0 to 100
So If I'm using just the '+1' operation, I start at 0 and need to get to 100. Since I can only add 1 each time, I would perform 100 '+1' operations.
So, it takes me 100 steps to reach 100 using only the '+1' operation.
Part B: Reaching 100 using both '+1' and 'x2' operations.
Now, if I can use both '+1' and 'x2' operations, I want to reach 100 as quickly as possible. The best strategy is to use the 'x2' operation whenever I can, since it doubles my current number and speeds things up a lot.
Here’s how I would do it:
- Start at 0.
- Add 1: 0 + 1 = 1.
- Double: 1 × 2 = 2.
- Double: 2 × 2 = 4.
- Double: 4 × 2 = 8.
- Double: 8 × 2 = 16.
- Double: 16 × 2 = 32.
- Double: 32 × 2 = 64.
- Add 1: 64 + 1 = 65.
- Double: 65 × 2 = 130.
- Subtract 1 until I reach 100.
By strategically doubling and adding, I can cut down the number of steps significantly compared to just using '+1'.
Unfortunately, I didn't find any platforms similar to Code.org or Blockly Games. I searched extensively, but most sites required a subscription or purchase, which was quite disappointing. However, I've read the suggestions from other participants and will definitely explore the sites and apps they’ve shared to see if any of them can help.
So that's it from today's blog I hope you will like it. With best wishes ❤️. Now I like to invite @norat , @mile16 and @abdul-rakib to participate in this amazing contest.
Upvoted. Thank You for sending some of your rewards to @null. It will make Steem stronger.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
This post has been upvoted/supported by Team 7 via @philhughes. Our team supports content that adds to the community.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit