Once upon a time, in a magical land of ice and snow, there lived a colony of adorable penguins who loved to code! ๐งโจ
CodePenguin is a special programming language made just for you! It's like telling a story about penguins, but the story is actually a computer program! How cool is that? ๐
- ๐ง Super Fun! Every program reads like a cute penguin adventure!
- ๐ Secretly Educational! You're learning real programming while having fun!
- ๐ Colorful & Beautiful! Everything is bright and cheerful!
- ๐ Kid-Friendly! Made especially for ages 9 and up!
First, make sure you have Python 3 installed on your computer! Then:
# Clone this repository (or download it)
cd "Project Code Penguin"
# That's it! You're ready to go! ๐Let's write your very first CodePenguin program! Create a file called hello.cp:
An adorable colony gathers called HelloWorld
squawk "๐ง Hello, World! Welcome to CodePenguin! ๐ง"
The colony joyfully disperses
Now run it:
python codepenguin.py hello.cpWow! Did you see that? You just wrote your first program! ๐
Want to try things out quickly? Start the interactive playground:
python codepenguin.pyYou'll see this friendly message:
๐ง Welcome to CodePenguin! ๐ง
Brr-ello, little chick! Ready to waddle some code?
Type your penguin story and press Enter twice to run it!
๐ง >>>
Just type your code and press Enter twice to run it! It's that easy! ๐ง
An adorable colony gathers called MyProgram
preen Your code goes here!
The colony joyfully disperses
Give a penguin a pebble (variable) with a value:
gift pebble name with "Penguin"
gift pebble age with 5
gift pebble favoriteNumber with 42
Make your penguin squawk (print) something:
squawk "Hello, world!"
squawk name
squawk "I am "
squawk age
squawk " years old!"
Create a list of things:
crรจche of chicks friends = ["Alice", "Bob", "Charlie"]
crรจche of chicks numbers = [1, 2, 3, 4, 5]
For loops - March over a list:
march over friends giving each friend
squawk "Hello, "
squawk friend
squawk "!"
While loops - Porpoise while something is true:
gift pebble count with 10
porpoise while count > 0
squawk count
gift pebble count with count - 1
squawk "Blast off! ๐"
Create a huddle (function) that penguins can dive into:
huddle greet name
squawk "Hello, "
squawk name
squawk "! ๐ง"
end huddle
dive into greet("Penguin")
Help your penguin make choices:
gift pebble age with 10
if age >= 10
squawk "You're a big penguin!"
else
squawk "You're still a little chick!"
Get a random number:
gift pebble luckyNumber with random pebble between 1 and 100
squawk "Your lucky number is "
squawk luckyNumber
Mix up a list:
crรจche of chicks colors = ["red", "blue", "green"]
huddle-shuffle colors
Save something to a file:
gift pebble score with 1000
nest "highscore.txt" with score
Do math just like in school:
gift pebble a with 10
gift pebble b with 5
squawk a + b preen Addition
squawk a - b preen Subtraction
squawk a * b preen Multiplication
squawk a / b preen Division
Add notes to your code:
preen This is a comment! Penguins use it to leave notes!
gift pebble x with 5 preen This sets x to 5
Check out the examples/ folder for lots of fun programs:
- Hello World - Your first program! ๐ง
- Variables - Learning about pebbles! ๐
- Number Guessing Game - A fun game! ๐ฎ
- Fibonacci - Math magic! โจ
- Lists - Working with crรจches! ๐ฃ
- Arduino LED - Generate MicroPython code! ๐ก
- Turtle Penguin - Draw a penguin! ๐จ
- Feed the Penguin - A complete game! ๐
- Shuffle Game - Mix things up! ๐
- Math Fun - Practice math! โ
- Functions - Learn about huddles! ๐ค
- Countdown - Count backwards! โฐ
- File Operations - Save your data! ๐พ
- Random Adventure - Daily adventures! ๐ฒ
Try running them all:
python codepenguin.py examples/01_hello_world.cp
python codepenguin.py examples/02_variables.cp
# ... and so on!If something goes wrong, don't worry! CodePenguin will help you with friendly messages:
- "Oops! A penguin slipped on the ice โ you forgot to end your huddle!"
- "That pebble wasn't gifted yet! Try 'gift pebble name with value' first."
- "The crรจche is empty! You tried to march over nothing."
Every error message is designed to help you learn! ๐
For more experienced penguins, you can enable strict mode:
emperor mode on
An adorable colony gathers called StrictProgram
preen This mode catches more errors!
The colony joyfully disperses
Chain operations together:
gift pebble result with 10 โ toboggan โ multiply(2)
- Start Simple! Begin with hello world and work your way up!
- Read the Examples! The examples folder has lots of great code to learn from!
- Experiment! Try changing things and see what happens!
- Have Fun! Programming should be fun! If you're stuck, take a break! ๐ง
- Ask for Help! It's okay to ask questions! That's how we learn!
While you're having fun with penguins, you're secretly learning:
- โ Variables and data types
- โ Functions and code organization
- โ Loops and iteration
- โ Conditionals and decision-making
- โ Lists and data structures
- โ File I/O
- โ Programming concepts that work in any language!
Want to make CodePenguin even better? We'd love your help! ๐ง
CodePenguin is free and open source! Use it, learn from it, and share it with your friends! ๐
Thank you for choosing CodePenguin! We hope you have as much fun learning to code as we had making this language! ๐งโจ
Remember: Every great programmer started with their first "Hello, World!" You're on an amazing journey! ๐
Happy Coding, Little Penguin! ๐ง๐
Made with โค๏ธ for young programmers everywhere