Commit Graph

3 Commits

Author SHA1 Message Date
Chris Mekelburg 12286b4e53 checkpoint 2 drawing with shapes
A function is like a variable because it allows something to be
repeated over and over again. In this case, the "something" is a set of
commands rather than a value. If a function that is called many times
needs to be changed, it only needs to be changed once, where the
function is defined.

Functions help to break down larger problems into smaller problems by
breaking down a larger task (such as drawing the complex shapes) into
a series of smaller tasks that are repeated. It is then easier to
troubleshoot the smaller task before looking at the larger task.
Another example would be if you have a block of code to make a robot
move, functions for moving forward, reverse, and turning could be
repeated over and over again. If the turn is off by a few degrees,
the turning function could be adjusted, rather than trying to need to
look through the entire code and finding every time the robot turns.
2024-09-01 16:49:29 -04:00
Chris Mekelburg b4fcd7a205 circle area and name code updated checkpoint1
A name is different from a value because a value always has the same
identity (2 is always 2 for example), while a name can be changed to
refer to a different value. A name is a way to refer to a value, while
the value is the true identity of the item. An example of a name would
be UB and an example of its value would be a university composed of x
buildings and y students in Western New York. Even if the name of the
school changed, it would still be composed of the same buildings and
students.

Variables can be useful in programming when a value appears more than
once in a block of code and you may need to later change that value.
For example, you can run a motor by setting a command called
motor_speed=value and then run that motor 10 different
times in the code. If you later need to change the value of the speed,
you only need to change the value in one place, where the variable is
defined, rather than changing it each time the value appears in the
code.
2024-09-01 16:17:25 -04:00
cmekelburg 8da5e0f570 Initial commit 2024-08-27 23:08:15 +00:00