# More formal ideas relating to control flow

BBC Bitesize: Algorithms and Control Flow
Algorithms use control flow to make decisions about which order to do things. They can repeat actions or start new actions based on new information.

Computer programs use sequence, selection and iteration to control the flow of the program. These elements allow the program to make choices, change direction or repeat actions.

This is a bit more of formality with some concepts relating to control flow

### Sequence:

Commands are run in the order that you specify. In Hopscotch this is indicated by the order that you place the blocks.

### Selection:

You can choose to make some parts of your code are run while others are not, depending on a condition that you specify.

You might commonly see structures such as If Statements (or cases which we don’t have in Hopscotch though)

### Iteration/Repetition:

You can have specific parts of your code repeat, and choose the condition under which they repeat.

• a fixed number of times
• while/until a certain condition is true
• you can check the condition before each loop or after each loop
• infinite times

(We don’t have While loops in Hopscotch but this can be done manually)

## Questions

Why all this formality??

In the same way that you can decide you don’t need to know all the grammar points of each word in a sentence to construct writing, nor all the processes that go into making paint to create with it, nor all the psychology of human beings to have a nice conversation with someone, nor all the workings of the world to go about it, you don’t need to define every concept to use it while programming

I mean knowing more about linguistics can help you with writing effective sentences, knowing about what paint works well on which medium depending on its contents can help you use it to great effect and knowing about some computer science ideas can help you with programming.

But you get to decide: if formality excites you and provides a platform for another way of thinking of a framework for structuring your ideas, if you want to create organically without putting a name to everything, go for whichever – you are fine wherever you are!

(If doing something, that someone has told you is helpful, actually dulls the experience instead, I might say that is more unhelpful in that it is dulling your delight in doing it if anything… but anyway it is up to you :))

You can make flowcharts to represent processes or algorithms along with these ideas too

Where did you get this from?

It doesn’t matter too much because you can learn it from lots of places – yeah I was introduced to it more formally through physical classes but everyone’s using it subconsciously in Hopscotch so `¯\_(ツ)_/¯`

Personally for me, I find formality can help with some other or more defined ways of approaching things, but I also love organic flow and discovering our own ideas.

Now here is a link I just found while searching:

BBC Bitesize: Algorithms and Control Flow

(It looks great and you are much better off looking at that than looking at what I have from memory )

23 Likes

Woah this is so interesting!
BTw I love ur writing

4 Likes

Hehe aw thanks for commenting, I didn’t think it would be overly interesting for everyone but glad to hear that!

And at first I thought you were talking about writing as in my [rather badly-structured] sentences but then I realised you meant writing as in my [messy scrawled] handwriting XD

7 Likes

Hmm I don’t really get what this topic about could you maybe explain??

4 Likes

Ooh thank you for letting me know, now I realise it is pretty vague I moved a part of what I found from the bottom to the start… I will keep trying to clear it up.

6 Likes

Yeah it’s about the handwriting ur handwriting is very similar to mine!!

4 Likes

Oh okay @Dolphin_coders I think it could actually be helpful to discuss here e.g. if we bring up any more content, it might help with anyone who is wondering about something too, or someone else might think that something is unclear too and it will be kept here, but it is up to you (for me, you don’t need to worry about clogging the topic if it’s related, it is helpful to me if anything)

6 Likes

You’re examples of control flow are really basic.

Control flow only becomes a semi-interesting topic, when we deal with self modifying control structures.

1 Like
I'm done with this

AHEM!

You’re talking to one of the smartest people on the forum. I just thought maybe you’d like to know that
(No, not me, it’s t1. She’s pretty smart)

1 Like

Being very modest, are we?

I'm done with this

Sorry, I was saying that the person you were talking to (not me, lol) is very smart

Also, I’m kind of mad and disgruntled
We need to resolve this. I made a post in the Numberphile Topic and I am highly certain that you have read it

I am uncertain about quantum physics

2 Likes

Being one of the smartest people on this forum is not an accomplishment.

You’re right, It’s not much of an accomplishment. I was meaning that you were saying something rude and implying the person wasn’t smart when t1 is one of the smartest people on the forum.

4 Likes

Hello hehe my understandings and articulation are indeed not so great. I have in mind too that here we have a lot of people who’ve never been introduced to these concepts before hmm complexity and accessibility is something of a balance. I rather like hearing about your insights if anything so I made it into a wiki – feel very free to add anything and wow self-modifying control structures?!

For JonnyGamer

And aw I really appreciate your thoughtfulness @JonnyGamer

(I feel glad that here on Hopscotch, we don’t have to worry about being smart or not, just glad to learn from each other too…) haha I don’t consider myself smart because we always have an opportunity to learn but i really appreciate what you mean for respect of each other too, i think it is really lovely

4 Likes
For t1

Hi, @t1_hopscotch, your welcome! You deserve it!
ihaveexpectations has actually been very mean and rude lately, and we need some help dealing with it (I think you missed most of the commotion). I have already contacted Liza and if you read
This topic http://forum.gethopscotch.com/t/we-are-resolving-this/35036?u=jonnygamer
And my Numberphile Topic, even Build A Snowman was awaken form his place and got disgruntled.

I think we should just ignore him now. He’s swearing and saying very rude things that Code against the code of conduct and terms of agreement

4 Likes

@t1_hopscotch how did you create the smaller graph for the editor on paper??

3 Likes

Oh, hmm which one is that sorry?

3 Likes

I wil get it in a second (sorry I couldn’t find the right topic)

3 Likes
3 Likes

Ah I see the app Paper makes it really easy to draw squares and rectangles and straight lines:

I realised just now that in the first photo for this topic, I used the old style for the Draw Trail and Repeat blocks whoopsies

5 Likes