Welcome back to the CodeNewbie Challenge! It is January and perhaps you have made a coding resolution, or you are just looking to improve your skills.
Whatever your next step, I hope that you are ready to start working on some CodeNewbie Challenges.
Hello CodeNewbies
This challenge will be to write a program that says hello. The program may be written in the language of your choice. As always, the challenge is split into three levels. Please choose your level based on your available time and your comfort level with the challenge.
A note about specifications
Each level will contain one or more specifications. These specifications describe the level in a structured way. Each specification will have three parts starting with ‘given’, ‘when’, and ‘then’. Each of those parts has a specific purpose.
Given - This is where setup goes; it says what is expected to already exist.
When - Change happens here; this describes the action that is taken.
Then - Describes the results of the change.
Level 1
For this level, write a program that will print “Hello CodeNewbies!” to the screen when it is run.
Specification
Given your program
When the program is run
Then it will say “Hello CodeNewbies!”
Level 2
There are lots of great languages to learn including Ruby, Python, and Javascript. For this level, make your program say hello to the language it’s written in and also to CodeNewbies.
Specification
Given a program written in Python
When the program is run
Then it will say “Hello Python!”
and it will say “Hello CodeNewbies!”
Level 3
Now, let’s make a program that will take zero or more languages and say hello to them, and then say hello to CodeNewbies.
Specification
Given a level 3 program
When it is run with “Ruby” and “Javascript”
Then it will say “Hello Ruby!”
and it will say “Hello Javascript!”
and it will say “Hello CodeNewbies!”
Given a level 3 program
When it is run without any languages
Then it will say “Hello CodeNewbies!”
More Information
This challenge is based on one of the classic ways to begin programming in a language, generally known as “Hello World”. The Hello World exercise is a great way to get started learning.
Here is a listing of the Hello World exercise in over 200 languages.
The specification format comes from acceptance testing and behavior driven development.
Thank You For Your Participation
I hope that you enjoyed this challenge. If you are looking for additional CodeNewbie Challenges there is a list available on CodeNewbie Discourse.
Have an Idea for Challenge?
If you have an idea for a challenge, we would like to know about it. Please share your idea by posting it to the discourse thread.
Sharing your Solution
If you have created a solution to a challenge and have not yet shared it to discourse, please do so. We have seen solutions in a variety of languages and styles and posted there and would love to see yours too.