[Output] Learn Ruby from what you want to do at the fastest speed-Part 2 "Create a flowchart"

Introduction

Good morning everybody! This article is Part 2 of "Learn Ruby Fastest from What You Want to Do".

In this series of articles, you will understand the basics of Ruby while moving your hands through "creating an original program", and actively "let's output!"

Of course, input is also important. But more important than that.

This time, I was planning to explain how to decompose the function based on the flowchart (like figure) mentioned in the first article, but before that, I will explain how to transcribe the flowchart (wind).

Target readers

This article is aimed at people who are "beginners in programming" and "want to make something!". This is a serialized article, so if you haven't read the first article yet, please read this first.

[Output] Learn Ruby from what you want to do at the fastest speed, part 1 "Think about what you want to make" --Qiita

What to learn in this article

In this article, you will learn the following knowledge about creating flowcharts (like) transcribed in the first article.

--Structured programming

Understanding and applying this knowledge should make the complex process flow easier to read and understand. It's a short content, but please try to proceed with a tea break from time to time.

Operating environment

Structured programming

First, what is structured programming?

"Structured programming is the idea of ​​dividing a program into functional unit parts and forming the whole by combining them." (Kitami, 2020, p.539)

In structured programming, programming is basically performed using only the following three control structures.

--Sequential structure (processes are executed in order from the top) --Selection structure (branch according to some condition and execute either process) --Repeat structure (Repeat a certain process until a certain condition is satisfied)

programming_structures.png

Verbalize the flow of the game

Now that you understand the three control structures of structured programming, let's verbalize the flow of the game. This time, I will write down the general flow by referring to the game "Ah, peel, whip!".

Game start ⇨ User up / down / left / right selection ⇨ Computer up / down / left / right selection ⇨ User win / loss ⇨ Continue ⇨ Game end

If you apply the written rough flow to the control structure explained above, ... Don!

flow-chart.png

It is a flowchart that combines a sequential structure, a selection structure, and a repeating structure! In this game, the result is a combination of three structures, but depending on the content, there should be only one or a combination of two.

Summary

How was that? This time, the content was quite short.

In this article, I learned the following:

--Structured programming --Sequential structure --Selection structure --Repeating structure --Verbalization of game flow

If you can understand the contents of this time, there should be more variations in flowchart creation!

In the next article, I'll talk about "functional decomposition" (this time).

I want to learn Ruby from what I want to do! If you are a reader, please continue reading the next and subsequent articles.

Thank you for watching until the end (^-^) /

Reference book

--Kitami-style illustration IT school basic information engineer

Recommended Posts

[Output] Learn Ruby from what you want to do at the fastest speed-Part 2 "Create a flowchart"
[Output] Learn Ruby from what you want to do at the fastest speed ・ Part 1 "Think about what you want to make"
How to create a route directly from the URL you want to specify + α
What to do if you accidentally create a model
What to do if you can't install the plugin from the Eclipse marketplace
[Ruby] I want to do a method jump!
What to do when you want to delete a migration file that is "NO FILE"
3. Create a database to access from the web module
[Solution] What to do if you get a Docker error'ERROR: Cannot connect to the Docker daemon at unix: ///var/run/docker.sock. Is the docker daemon running?'
What to do if you change the Listen Address from the settings screen with Mattermost docker
When you want to change the wording to be displayed when making a select box from enum
What to do if you installed Ruby with rbenv but the version does not change
[Rails Tutorial Chapter 2] What to do when you make a mistake in the column name
What to do if you get a java.io.IOException in GlassFish
How to create a form to select a date from the calendar
I want to create a form to select the [Rails] category
What I did in the version upgrade from Ruby 2.5.2 to 2.7.1
I want to create a Parquet file even in Ruby
What to do if you can't use the rails command
What do you need after all to create a web application using java? Explain the mechanism and what is necessary for learning
What to do when you want to know the source position where the method is defined in binding.pry
I want to create a chat screen for the Swift chat app!
What to do if you get a gcc error in Docker
Want to know what Ruby n is the power of 2? (Power judgment of 2)
If you want to change the Java development environment from Eclipse
What to do if you get a DISPLAY error in gym.render ()
What to do when you become a Problem During Content Assist
What to do when you run into a docker-compose node_modules problem
What to do if you forget the root password in CentOS7
(Ruby on Rails6) Create a function to edit the posted content
What to do if you cannot roll back the migration (UnknownMigrationVersionError)
What to do if you can't bundle update and bundle install after installing Ruby 3.0.0 in the Rails tutorial
What to do if you get the error Too long with no output (exceeded 10m0s) on CircleCI
[Ruby] I want to output only the odd-numbered characters in the character string
A memo when you want to clear the time part of the calendar
What to do if you get a groovy warning in Thymeleaf Layout
I thought about the best way to create a ValueObject in Ruby
If you want to make a zip file with Ruby, it's rubyzip.
I want to find out what character the character string appears from the left
What to do if you get a MiniMagick vulnerability alert on GitHub
What to do if you get an "A server is already running." Error when you try to start the rails server
[Ruby] I want to make an array from a character string with the split method. And vice versa.
[Ruby] From the basics to the inject method
What to do when a javax.el.PropertyNotWritableException occurs
Basic Rails commands you want to learn
What to do if you install Ubuntu
From terminal to Ruby (standard input / output)
What to do if you get a SQLite3 :: BusyException: database is locked error
<f: ajax> Unable to attach <f: ajax> to non-ClientBehaviorHolder What to do when you become a parent
What to do if you can't activate the select box created by bootstrap-select
What to do if you get the error message unrecognized selector send to instance "***"
What to do if you get To install the missing version, run `gem install bundler: 2.1.4`
Androd: What to do about "The Realm is already in a write transaction in"
Learn while making a WEB server Introduction to WEB application development from the basics
[Ruby] When you want to assign the result obtained by conditional branching to a variable and put it in the argument
What to do if you can't find the JDK you put in SDKMAN after migrating from bash to zsh on macOS