California 4-H State Field Day 

In-person State Field Day
May 27, 2023
UC Davis Wellman Hall and Hart Hall

Virtual State Field Day Contests
May 10-20, 2023


4-H Coding Challenge


State Coding Contest website banner


Register for Coding Challenge

In person at State Field Day, May 27, 2023, 11:00am-12:00pm

Register as an individual or as part of a team. If you are registering as part of a team, please make sure to list your team members in your registration. 

4-H Coding Challenge

The 4-H Coding Challenge at State Field Day allows members the opportunity to showcase their computer science (CS) skills. It lets members see what other projects their peers across the state are building to cultivate curiosity around the CS field. Any 4-H'er (age 9 to 18) can submit a project as an individual or as part of a group.

Presenting your code

When it’s your turn to present, share your screen or use our laptop live to present your code. Your presentation should be 3-10 minutes and include the following information:

  • What is the purpose of your code/application/game?
  • What was the most challenging part to code?
  • If you had more time, what would you like to improve?
  • What part are you the most proud of?
  • What advice would you give to someone else trying to make a project like this?
  • Short demonstration of your application.

Questions? Please contact
Competition Coordinators: Sudharsan Gopalakrishnan

Beginners Coding Challenge: Submit any two entries of your choice from the list below.

  • Create a game where the player controls a character who has to collect objects while avoiding obstacles. Use the Scratch CS First "Game Design" unit to learn about game mechanics and design principles.
  • Create an interactive animation that tells a story. Use the Scratch CS First "Animation" unit to learn about the principles of storytelling, animation, and character design.
  • Build a calculator that can perform basic mathematical operations such as addition, subtraction, multiplication, and division. You can use Python's built-in math functions and input/output functions to create a simple calculator.
  • Write a program that converts temperatures between Fahrenheit and Celsius. You can use simple mathematical formulas to convert temperatures and input/output functions to get user input and display output.
  • Create a program that generates a random number and asks the user to guess the number. You can use Python's random module to generate random numbers and input/output functions to get user input and display output.
  • Write a program that checks if a word is a palindrome (i.e., the word is spelled the same way forwards and backwards). You can use Python's string manipulation functions to reverse the string and compare it to the original string.
  • Create a simple game where the user has to guess a word. You can use Python's input/output functions to get user input and random module to select a random word from a list. You can also add a scoring system to make the game more challenging.


Advance Coding Challenge 1: "Virtual Pet"

Objective: Create a virtual pet that users can interact with and take care of. The virtual pet should be able to eat, play, sleep, and get sick if it's not taken care of properly. Users should be able to see their virtual pet's health status and happiness level.

Skills Required: Basic understanding of programming concepts such as variables, functions, and conditional statements. Familiarity with a programming language such as Python, JavaScript, or Scratch.


  • Choose a programming language and environment to build your virtual pet. For example, you can use Python with a Pygame library or Scratch.
  • Create the virtual pet's character design and choose its name.
  • Define the virtual pet's attributes such as its health status, hunger level, and happiness level using variables.
  • Create functions that simulate the virtual pet's actions such as eating, playing, sleeping, and getting sick.
  • Implement conditional statements that change the virtual pet's attributes based on user input or elapsed time. For example, if the virtual pet doesn't eat for a certain amount of time, its hunger level should increase and its health status should decrease.
  • Add a user interface that displays the virtual pet's attributes and allows users to interact with the virtual pet.
  • Test the virtual pet's functionality and adjust the code as necessary.
  • Add additional features to the virtual pet such as mini-games or achievements.
  • Share your virtual pet with others and get feedback on how to improve it.
  • Prepare a short presentation on how you built the virtual pet and what you learned from the project.

Good luck with your project!      


Advance Coding Challenge 2: Create a game using Python.

Objective: To create a game using Python that teaches a specific concept or skill.


  • Choose a concept or skill that you want to teach through your game. Examples include addition, multiplication, geography, spelling, or coding basics.
  • Decide on the rules and gameplay of your game. Will it be a quiz-style game, a guessing game, or a puzzle game? Will it have levels of difficulty or power-ups?
  • Write the code for your game using Python. Use loops, if/else statements, and functions to make the game work.
  • Test your game and make adjustments as needed.
  • Optional: Add graphics or sound effects to make your game more engaging.
  • Prepare a brief presentation about your game, including the concept or skill it teaches, the rules and gameplay, and how you coded it.
  • Share your game and presentation with others, and encourage them to play and learn from your creation!

Some possible game ideas:

Math quiz: create a quiz game that asks simple math questions and keeps score of correct answers.

Geography game: create a game that asks players to identify countries, states, or capitals on a map.

Spelling game: create a game that asks players to spell words correctly.

Memory game: create a game that challenges players to remember a sequence of numbers, letters, or images.

Coding basics game: create a game that teaches the basics of coding, such as using variables, loops, and conditionals.

Remember to have fun and be creative with your game! Good luck and have a great time at 4-H State Field Day.