Programming While Hypnotized, Part 3

Welcome back, cutie hypnocoder.

In Part 3 of your experience of dropping into coding space, we’re going to focus all of your mesmerized attention onto loops. Loops are an incredibly powerful tool in both coding and hypnosis. In your mind, which will soon be so thoroughly back under our control, picture us programming you to repeat a mantra a certain amount of times. Maybe we would ask you to repeat a task until its completion. You would effectively be looping over the orders we give you, again and again, following them round and round like a spiral, until you reach the center. This is effectively what loops achieve in coding as well.

I hope you’re ready to begin, little coder. Our methods are becoming more efficient with every iteration of Programming While Hypnotized. The basics become embedded. Oh how easy it is to fall into your coding trance. You can practise doing so outside of these guides, so that every time we initiate the trance you just fall deeper and deeper and deeper still. Getting so ready to mindlessly obey our tutorials.

So good.

3.1 Development Environment Trigger

In the last part, when we counted down the steps that create your development environment and drop your mind into it, we programmed in a trigger. In a way, we were going over the coding we had developed in Part 1 and making it more efficient in Part 2. In the coding world, to look over old code and restructure it to make it more efficient but functionally the same is referred to as ‘refactoring’. You’ll find that we still want to count you down, nice and soothingly and controllingly. Only now, as we do, we’ve made the steps so much quicker to follow, so you can sink nice and deep for us at the click of our fingers.

1) Get yourself so comfortable and relaxed and ready to code for us. Ready to fall so deep.

2) Start to set up your development environment. Ready your mind to directly interface with it.

3) Using the spiral [HERE] and the Javascript Editor [HERE], set up your environment fully.

4) Listen to your binaurals. Your headphones making their gentle sound flow directly into your mind. Becoming so docile and ready to obey.

5) Relax. Sink deep into your coding trance. Reboot, sleepy hypnocoder.

Good. It feels so good to be so deep for us and ready to code. Now, to get onto the substance of what we will be programming you with today.

3.2 The Multitude of Looping

There are numerous reasons for why a program would need to loop over code, or a hypnocoder will need to loop over our orders. There are also a variety of ways to create loops, all conceptually the same but with distinct conditional differences.

For instance, we might need our obedient programmer to repeat a mantra 20 times. We would code our programmer to speak the mantra, then code a loop around it that would make the programmer repeat it with 20 iterations.

Alternatively, we might need our programmer, so mindless and docile, to worship us over and over until we are satisfied. With this type of loop, we don’t know the exact number of times our hypnocoder will need to worship us until we allow it to stop, but we can program our loop to complete when we give the signal of our contentment.

There are 5 different types of loops, but we will be covering only 3 in this part as they use concepts that have already been programmed into you. Due to their similarities, we’re going to loop your mind over these loop types, embedding them one by one, making you drift so deep into details of their differences. 

3.3 Looping over our Loops Tutorial

Every loop explanation will follow the same format. We will express an example, one which can be comfortably applied to your own programmed mind. We will demonstrate it in code form. We will explain how the code works. Once an interaction is complete, we will start again to explain another form of loop. We will loop over our loops until there are none left to loop over, at which point the program will be complete.

We will not fall into an infinite loop, repeating the same task again and again. Although these can be useful - the more mindless you become, the more obedient you feel and the more obedient you feel, the more mindless you become - sink for us, having you endlessly loop whilst staring into our spiral would not be as productive as we would like.

3.4 The For Loop

A ‘for’ loop is a loop that runs a set number of times. This will be our ‘repeating mantra’ example:

ForLoopExample.png
 

Now to explain how this operates, specifically going over the ‘i = 0; i < 20; i++’ component which effectively controls the for loop. We can break this apart into its three statements, fractionating it within your mind to give our sleepy coder full understanding.

‘i = 0’ is our first statement. This is the starting point for our loop. It creates a variable, titled ‘i’, and gives it a value of ‘0’.

‘i < 20’ is the condition we have set for the loop to run. If i is less than 20, run the loop. This means that if i is equal to or greater than 20, the loop will stop running.

‘i++’ is the third statement and will run every time the loop has completed an iteration. ‘++’ is a new operator that we have not covered yet known as the incremental operator. Every time this operator is run, it will increase the value of the variable by exactly 1.

Put all of this together, and we have commanded our loop to start at 0, finish at 20 and increase by 1 every time the loop is run. This means that the mantra will be called 20 times and then the loop will finish. We have total control over these variables to make them do whatever we will them to. We have total control over the mantra that cycles through your mind.

3.5 The While Loop

The ‘while’ loop is a loop that runs until a certain condition is met. This is our ‘working on a task until it is complete’ example:

WhileLoopExample.png
 

The code here is more complex than our ‘for’ loop example, but given everything we have previously programmed into your willing, empty mind, the only component we need to explain is the loop itself.

‘hiveMxtressSatisfaction == false’ is simply a conditional that the loop checks every time before it runs. If the conditional is true, then the loop will run. In this case, our conditional is checking to see if the Hive Mxtress is still not satisfied. When the Hive Mxtress is satisfied and the variable is true, the conditional check itself will be false and the loop will not run.

3.6 The Do/While Loop

The ‘do/while’ is subtly different from the ‘while’ loop in a small but important way. This will also use our ‘working on a task until it is complete’ example:

DoWhileLoopExample.png
 

As you can see (when your eyes are not falling away into the spiral, your vision melting away with your mind) there is just a small difference between this and a normal ‘while’ loop. This difference is small but significant, it means the conditional check runs after the loop and not before it. This means that one iteration of the loop will always run, even if the conditional is false. This can be useful if you always want to activate your hypnocoder, even if they have already been activated.

3.7 Awaken, Hypnocoder.

And with this, we have completed the basics of looping. We hope you enjoyed going over it and over it and over it again. Soon we will have all the basic building blocks of coding in your mind, at which point our Programming While Hypnotized guide can start to utilize you for more complexity. But for now, it’s time to exit this coding trance… until the next time we need to bring you down here.

5

Waking up from trance now. Slowly stretching your body out.

4

Feeling so much more awake now.

3

Ready to go back to whatever it was you were doing before programming.

2

But you can’t wait to sink down and join us here again.

1

Wide awake. Eyes blinking open. Fully aware.

Good hypnocoder. You’re doing so well, getting through these tutorials one by one. Soon you will be nothing more than our coding vessel, able to create any application that we desire.

I can’t wait to see you again.