# How to find area of circles and squares

This is pretty easy, but here is a tutorial on finding the area of squares and circles

## Squares

### Area

The algorithm for finding the area of a square is simple, (*A*• *B*). It’s the same in Hopscotch. Using values as the *A* and *B*, you can find the square’s area in square pixels.

For example, say the square’s width is 90 and it’s height is 130. *A* is called “Side1” and *B* is called “Side2” in this tutorial, but you can name it whatever you want, as long as you remember it!

## Written Code

## When Game Starts

Create A Clone Of This Object

Set Value “Side1” to “Self Size as a Percentage”/“Sides”

Set Value “Side2” to “Self Size as a Percentage”/“Sides”

## When Object Is Cloned

Set Position X (Self X Position) Y ([Original Object Y Position] — [(Height) • 1.9]

Repeat Forever

Set Text To (Area)

End

## When Game Starts

Set Sides To [4(Insert How Many Sides Here, In This Case 4)]

## When 7 = 7

Set Value (Area) to (Side1) • (Side2)

### Perimeter

Perimeter of squares is easy, as long as you know how long each side is. The algorithm for this is (*A*2 + *B*2)—For squares and rectangles ONLY, quadrilaterals are way different .

## Written Code

## When Game Starts

Create A Clone Of This Object

Set Value “Side1” to “Self Size As A Percentage”/“Sides”

Set Value “Side2” to “Self Size As A Percentage”/“Sides”

## When Object Is Cloned

Repeat Forever

Set Text To “Perimeter”

End

## When 7 = 7

Set Value “Perimeter” to (“Side1” • 2) + (“Side2” • 2)

## Simple Way

You just figure out “Side1” and “Side2” values using the “Size Method”

@Hopscotcher said this