Skip to content

Please update your browser

Your browser version is not supported by this site. CS First may not work properly. Learn more

1. Introduzione alle variabili


Hi and welcome to Activity 6 of Google CS First Sports!

In this activity, you will build a home-run-derby-style baseball game while you learn about the computer science concept called: variables.

Variables in computer science are places to store changing values.

For example, in Scratch, a variable can keep track of time or the x position of a sprite.

Most software uses variables to keep track of information.

StatzHub uses variables to compare athletes from different sports and to compare high school players to pros.

IBM’s SlamTracker keeps track of statistics that can help players and coaches analyze their performances, as well as give viewers real-time insight during a match.

These statistics are stored in variables, then used in visually appealing graphics.

Additionally, SportsVU and Synergy Sports Technology track players' locations using cameras, then store this data in variables.

Coaches use the data to understand their players’ strengths and weaknesses to create more successful teams.

For example, variables are used to keep track of how fast a player runs or how many times he or she touches the ball.

This project uses a variable in your baseball game to keep track of a baseball player’s batting average.

Once you open the starter project, you’ll see some extra sprites.

You only need one pitcher and one coach, so pick the ones you like and delete the rest.

Alright, here’s the game plan: Open the starter project by clicking the link, then click remix and sign in.

Delete the extra sprites, then come back to the CS First page to watch the next video.

Avanti arrow_forward
  1. Apri il progetto di partenza.
  2. Esegui il remix del progetto.
  3. Effettua l'accesso a Scratch.