From bdd1dc3486c3f61150944f20856ed41c30f152df Mon Sep 17 00:00:00 2001 From: "U-DESKTOP-RGBJJO6\\ybnvs" Date: Fri, 25 Jul 2025 08:22:53 +1000 Subject: [PATCH 1/4] Deleted current explore page --- .../3-building-programs/3-explore.md | 123 ------------------ 1 file changed, 123 deletions(-) delete mode 100644 src/content/docs/book/part-0-getting-started/3-building-programs/3-explore.md diff --git a/src/content/docs/book/part-0-getting-started/3-building-programs/3-explore.md b/src/content/docs/book/part-0-getting-started/3-building-programs/3-explore.md deleted file mode 100644 index 994e7c41..00000000 --- a/src/content/docs/book/part-0-getting-started/3-building-programs/3-explore.md +++ /dev/null @@ -1,123 +0,0 @@ ---- -title: Go Exploring ---- - -:::tip -Use the [installation guides](/book/appendix/0-installation/0-overview) to install the tools you need. -::: - -Here is a fun hello world program to wrap up this section. You can also look through the guide and fine other sample code you can download and run now. This is a great way to explore the ideas you are learning. - -The code for this part will be using SplashKit functionality to draw images, play sound effects and draw text with a specific font. - -:::note[Reminder] -You're not expected to understand how the following code works at this point. It has been created for fun, so you can just copy and paste - and enjoy another "Hello World!" GUI program! -::: - -Create a new project, copy the following code, and paste it into your Program.cs file (replacing existing code). Run this program using `dotnet run`: - -```cs -using static SplashKitSDK.SplashKit; - -// download resources -DownloadSoundEffect("Hello World", "https://programmers.guide/resources/code-examples/part-0/hello-world-snippet-saddle-club.ogg", 443); -DownloadFont("main", "https://programmers.guide/resources/code-examples/part-0/Roboto-Italic.ttf", 443); -DownloadBitmap("Earth", "https://programmers.guide/resources/code-examples/part-0/earth.png", 443); -DownloadBitmap("SmallEarth", "https://programmers.guide/resources/code-examples/part-0/earth-small.png", 443); -DownloadBitmap("SplashKitBox", "https://programmers.guide/resources/code-examples/part-0/skbox.png", 443); - -OpenWindow("Hello World: Using Resources with SplashKit", 800, 600); -PlaySoundEffect("Hello World"); - -ClearScreen(ColorWhite()); -DrawText("Anyone remember the \"Hello World\" Saddle Club song?", ColorBlack(), "main", 30, 40, 200); -RefreshScreen(); -Delay(2500); - -ClearScreen(ColorWhite()); - -// H -DrawBitmap("SmallEarth", 20, 100); -DrawBitmap("SmallEarth", 20, 130); -DrawBitmap("SmallEarth", 20, 160); -DrawBitmap("SmallEarth", 20, 190); -DrawBitmap("SmallEarth", 20, 220); -DrawBitmap("SmallEarth", 52, 160); -DrawBitmap("SmallEarth", 84, 100); -DrawBitmap("SmallEarth", 84, 130); -DrawBitmap("SmallEarth", 84, 160); -DrawBitmap("SmallEarth", 84, 190); -DrawBitmap("SmallEarth", 84, 220); -RefreshScreen(); -Delay(200); - -// E -DrawBitmap("SmallEarth", 148, 100); -DrawBitmap("SmallEarth", 148, 130); -DrawBitmap("SmallEarth", 148, 160); -DrawBitmap("SmallEarth", 148, 190); -DrawBitmap("SmallEarth", 148, 220); -DrawBitmap("SmallEarth", 180, 100); -DrawBitmap("SmallEarth", 212, 100); -DrawBitmap("SmallEarth", 180, 160); -DrawBitmap("SmallEarth", 180, 220); -DrawBitmap("SmallEarth", 212, 220); -RefreshScreen(); -Delay(200); - -// L -DrawBitmap("SmallEarth", 276, 100); -DrawBitmap("SmallEarth", 276, 130); -DrawBitmap("SmallEarth", 276, 160); -DrawBitmap("SmallEarth", 276, 190); -DrawBitmap("SmallEarth", 276, 220); -DrawBitmap("SmallEarth", 308, 220); -DrawBitmap("SmallEarth", 340, 220); -RefreshScreen(); -Delay(200); - -// L -DrawBitmap("SmallEarth", 404, 100); -DrawBitmap("SmallEarth", 404, 130); -DrawBitmap("SmallEarth", 404, 160); -DrawBitmap("SmallEarth", 404, 190); -DrawBitmap("SmallEarth", 404, 220); -DrawBitmap("SmallEarth", 436, 220); -DrawBitmap("SmallEarth", 468, 220); -RefreshScreen(); -Delay(200); - -// O -DrawBitmap("SmallEarth", 530, 160); -DrawBitmap("SmallEarth", 622, 160); -DrawBitmap("SmallEarth", 540, 128); -DrawBitmap("SmallEarth", 560, 100); -DrawBitmap("SmallEarth", 592, 100); -DrawBitmap("SmallEarth", 612, 128); -DrawBitmap("SmallEarth", 540, 192); -DrawBitmap("SmallEarth", 560, 220); -DrawBitmap("SmallEarth", 592, 220); -DrawBitmap("SmallEarth", 612, 192); -RefreshScreen(); -Delay(500); - -// World -DrawBitmap("Earth", 100, 350); -RefreshScreen(60); -Delay(2000); - -// SplashKit ("Me") -DrawBitmap("SplashKitBox", 450, 300); -DrawText("SplashKit!", ColorBlack(), "main", 50, 450, 530); -RefreshScreen(60); -Delay(2000); -``` - -Following a bit of a theme with *writing words out of something other than actual text*, we get this: - -
- -
- -🌏 Yes, that is "HELLO", written using "worlds" 😄 -(Because "HELLO" ... "*world*") From ea56a259ac8496561c46ab1bdb2441afc3d4ac71 Mon Sep 17 00:00:00 2001 From: "U-DESKTOP-RGBJJO6\\ybnvs" Date: Fri, 25 Jul 2025 08:24:18 +1000 Subject: [PATCH 2/4] added new explore content --- .../3-explore/3-1-hello-with-worlds.md | 123 ++++++++++++++++++ .../3-explore/3-2-test-knowledge.md | 8 ++ .../3-explore/3-3-classic-quote.md | 28 ++++ .../3-explore/3-4-paint-me.md | 18 +++ .../3-explore/images/smile.png | Bin 0 -> 6902 bytes 5 files changed, 177 insertions(+) create mode 100644 src/content/docs/book/part-0-getting-started/3-building-programs/3-explore/3-1-hello-with-worlds.md create mode 100644 src/content/docs/book/part-0-getting-started/3-building-programs/3-explore/3-2-test-knowledge.md create mode 100644 src/content/docs/book/part-0-getting-started/3-building-programs/3-explore/3-3-classic-quote.md create mode 100644 src/content/docs/book/part-0-getting-started/3-building-programs/3-explore/3-4-paint-me.md create mode 100644 src/content/docs/book/part-0-getting-started/3-building-programs/3-explore/images/smile.png diff --git a/src/content/docs/book/part-0-getting-started/3-building-programs/3-explore/3-1-hello-with-worlds.md b/src/content/docs/book/part-0-getting-started/3-building-programs/3-explore/3-1-hello-with-worlds.md new file mode 100644 index 00000000..a94490a0 --- /dev/null +++ b/src/content/docs/book/part-0-getting-started/3-building-programs/3-explore/3-1-hello-with-worlds.md @@ -0,0 +1,123 @@ +--- +title: Hello with Worlds +--- + +:::tip +Use the [installation guides](/book/appendix/0-installation/0-overview) to install the tools you need. +::: + +Here is a fun hello world program to wrap up this section. You can also look through the guide and fine other sample code you can download and run now. This is a great way to explore the ideas you are learning. + +The code for this part will be using SplashKit functionality to draw images, play sound effects and draw text with a specific font. + +:::note[Reminder] +You're not expected to understand how the following code works at this point. It has been created for fun, so you can just copy and paste - and enjoy another "Hello World!" GUI program! +::: + +Create a new project, copy the following code, and paste it into your Program.cs file (replacing existing code). Run this program using `dotnet run`: + +```cs +using static SplashKitSDK.SplashKit; + +// download resources +DownloadSoundEffect("Hello World", "https://programmers.guide/resources/code-examples/part-0/hello-world-snippet-saddle-club.ogg", 443); +DownloadFont("main", "https://programmers.guide/resources/code-examples/part-0/Roboto-Italic.ttf", 443); +DownloadBitmap("Earth", "https://programmers.guide/resources/code-examples/part-0/earth.png", 443); +DownloadBitmap("SmallEarth", "https://programmers.guide/resources/code-examples/part-0/earth-small.png", 443); +DownloadBitmap("SplashKitBox", "https://programmers.guide/resources/code-examples/part-0/skbox.png", 443); + +OpenWindow("Hello World: Using Resources with SplashKit", 800, 600); +PlaySoundEffect("Hello World"); + +ClearScreen(ColorWhite()); +DrawText("Anyone remember the \"Hello World\" Saddle Club song?", ColorBlack(), "main", 30, 40, 200); +RefreshScreen(); +Delay(2500); + +ClearScreen(ColorWhite()); + +// H +DrawBitmap("SmallEarth", 20, 100); +DrawBitmap("SmallEarth", 20, 130); +DrawBitmap("SmallEarth", 20, 160); +DrawBitmap("SmallEarth", 20, 190); +DrawBitmap("SmallEarth", 20, 220); +DrawBitmap("SmallEarth", 52, 160); +DrawBitmap("SmallEarth", 84, 100); +DrawBitmap("SmallEarth", 84, 130); +DrawBitmap("SmallEarth", 84, 160); +DrawBitmap("SmallEarth", 84, 190); +DrawBitmap("SmallEarth", 84, 220); +RefreshScreen(); +Delay(200); + +// E +DrawBitmap("SmallEarth", 148, 100); +DrawBitmap("SmallEarth", 148, 130); +DrawBitmap("SmallEarth", 148, 160); +DrawBitmap("SmallEarth", 148, 190); +DrawBitmap("SmallEarth", 148, 220); +DrawBitmap("SmallEarth", 180, 100); +DrawBitmap("SmallEarth", 212, 100); +DrawBitmap("SmallEarth", 180, 160); +DrawBitmap("SmallEarth", 180, 220); +DrawBitmap("SmallEarth", 212, 220); +RefreshScreen(); +Delay(200); + +// L +DrawBitmap("SmallEarth", 276, 100); +DrawBitmap("SmallEarth", 276, 130); +DrawBitmap("SmallEarth", 276, 160); +DrawBitmap("SmallEarth", 276, 190); +DrawBitmap("SmallEarth", 276, 220); +DrawBitmap("SmallEarth", 308, 220); +DrawBitmap("SmallEarth", 340, 220); +RefreshScreen(); +Delay(200); + +// L +DrawBitmap("SmallEarth", 404, 100); +DrawBitmap("SmallEarth", 404, 130); +DrawBitmap("SmallEarth", 404, 160); +DrawBitmap("SmallEarth", 404, 190); +DrawBitmap("SmallEarth", 404, 220); +DrawBitmap("SmallEarth", 436, 220); +DrawBitmap("SmallEarth", 468, 220); +RefreshScreen(); +Delay(200); + +// O +DrawBitmap("SmallEarth", 530, 160); +DrawBitmap("SmallEarth", 622, 160); +DrawBitmap("SmallEarth", 540, 128); +DrawBitmap("SmallEarth", 560, 100); +DrawBitmap("SmallEarth", 592, 100); +DrawBitmap("SmallEarth", 612, 128); +DrawBitmap("SmallEarth", 540, 192); +DrawBitmap("SmallEarth", 560, 220); +DrawBitmap("SmallEarth", 592, 220); +DrawBitmap("SmallEarth", 612, 192); +RefreshScreen(); +Delay(500); + +// World +DrawBitmap("Earth", 100, 350); +RefreshScreen(60); +Delay(2000); + +// SplashKit ("Me") +DrawBitmap("SplashKitBox", 450, 300); +DrawText("SplashKit!", ColorBlack(), "main", 50, 450, 530); +RefreshScreen(60); +Delay(2000); +``` + +Following a bit of a theme with *writing words out of something other than actual text*, we get this: + +
+ +
+ +🌏 Yes, that is "HELLO", written using "worlds" 😄 +(Because "HELLO" ... "*world*") diff --git a/src/content/docs/book/part-0-getting-started/3-building-programs/3-explore/3-2-test-knowledge.md b/src/content/docs/book/part-0-getting-started/3-building-programs/3-explore/3-2-test-knowledge.md new file mode 100644 index 00000000..a2a95249 --- /dev/null +++ b/src/content/docs/book/part-0-getting-started/3-building-programs/3-explore/3-2-test-knowledge.md @@ -0,0 +1,8 @@ +--- +title: Test your knowledge +--- + +Having explored this leg of the journey you are now approaching a rest stop and a chance to practice and reflect. Test what you have learnt by creating one or more of the following programs: + +- [Simple Writing](/book/part-0-getting-started/3-building-programs/3-explore/3-3-classic-quote/) using the terminal. +- [Simple Drawing](/book/part-0-getting-started/3-building-programs/3-explore/3-4-paint-me/) using the Splashkit library. diff --git a/src/content/docs/book/part-0-getting-started/3-building-programs/3-explore/3-3-classic-quote.md b/src/content/docs/book/part-0-getting-started/3-building-programs/3-explore/3-3-classic-quote.md new file mode 100644 index 00000000..b43204b2 --- /dev/null +++ b/src/content/docs/book/part-0-getting-started/3-building-programs/3-explore/3-3-classic-quote.md @@ -0,0 +1,28 @@ +--- +title: Simple Writing +sidebar: + label: " - The Power of Words" +--- + + +Write a tiny terminal application that simply greets the user and prints the opening line of your favourite book + +```txt +Welcome to the classic-quote generator! + +“It was a bright cold day in April, and the clocks were striking thirteen.” + +``` + +Or, Level‑up by presenting the greeting inside a very simple terminal‑based user interface — think of those chunky boxes you see in retro command‑line tools. Use a classic sci‑fi computer quote for the salutation. Example shown with HAL 9000 from 2001: A Space Odyssey. + +```txt ++--------------------------------------------------+ +| | +| Good evening, Dave. I’m HAL 9000. | +| "I’m sorry, Dave. I’m afraid I can’t do that." | +| | ++--------------------------------------------------+ +``` + +Stick to the commands and concepts we’ve already covered (e.g., WriteLine / print equivalents). Avoid extra prompts or calculations—keep it truly minimal. diff --git a/src/content/docs/book/part-0-getting-started/3-building-programs/3-explore/3-4-paint-me.md b/src/content/docs/book/part-0-getting-started/3-building-programs/3-explore/3-4-paint-me.md new file mode 100644 index 00000000..eb70a592 --- /dev/null +++ b/src/content/docs/book/part-0-getting-started/3-building-programs/3-explore/3-4-paint-me.md @@ -0,0 +1,18 @@ +--- +title: Simple Drawing +sidebar: + label: " - A Picture Worth 1000 Words" +--- + + +Write/modify a Splashkit application that draws a simple picture + +![An example picture or a smiling face](./images/smile.png) + +Follow the [Graphical Hello world](/book/part-0-getting-started/3-building-programs/1-tour/2-hello-world-gui) guide +and play around with adding or removing the shapes, to see if you can make something truly original. + +:::tip +Don't worry if it seems like magic for now, with time we will decipher what all of those "magic numbers" are... +Just have a play, and enjoy being able to create shapes +::: \ No newline at end of file diff --git a/src/content/docs/book/part-0-getting-started/3-building-programs/3-explore/images/smile.png b/src/content/docs/book/part-0-getting-started/3-building-programs/3-explore/images/smile.png new file mode 100644 index 0000000000000000000000000000000000000000..e4c1fab9b13f8d68c840197066220bd2c95b09ae GIT binary patch literal 6902 zcmeHMYdlo#+FuSeLo!HC#h^sxJSjp$DLEvMo^lE!4W)#{IAlg<8azZripHTNdXz&d zjlnQ-K2=XS%(>Z?seU3UH5-o*Z+U51V;z! z_2Nq6006AFIc((w0K!=CB0<-Jp0JY@p8!Cq+Q!QA_i)eY!LE{Vj7QV#jN+u;TKB>= zt@~v&EVYaj9VtjcB z0JydRd?qyl9I$}WA%N6=t`IEIQ=QuKTSgpIST`6 zr_kKx>EY<|rLV)>Nq$jk4Z6F-7viwcF=za>V3-nlIFpuRJ4@YzB;hq9rptiJTX>dlD>NbtY;kC~d8MaT% z&S%YBX1rSQOkAO=L`{`Nqy$Kv)^t(C4lgc@Gx6}n!<=h@9-n;u79_D%=SoZwE5WmW zF)HJbmvES`pY=FY&Qw%a7>+#+pTaG_@#0b6(>ZTb2d5Gkx2arz&gf9cV8eJx_griF z;8nKQOwHwSC(b+a?Mh8QuP-WnE0H_~#^rL?o=Uxd#T*gfcOU7)1qTQB4kKPP;0n4t zxOircZuC;}%7r4q`As{K1k70DwTP=VMN9N^&J?&{)SolcgB@CK+EfyXtQ7cTmKXay zDlk60tUc9Vn5MWHxx_P3_wP0h4PnVlkBA3L0=qV(dk?vw(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~12 zMtVi$c7nI@+P17QV|kxh3xqj_ua)HPx3@5m0M<*gv87ddaW7by& z{>Y3qjhRMF7mQvh*i1{=|LFSmgxat>tYd6ZM>)E6-MglDqNr;71(|S}Z*(-MHBVN( z^zy?98#6^PwZ929{H7%BBDtZ;DqFTygI`E^t91h)CAWC&I4S{ZwcoAKX%0}yrU%7W zG!y1PvYe;wuO^J~+uQRh^`J5VzR^k6NG7%baqZlALY@jO#r9FW+}5VtmVWW0TSKL> zzuWVl7d9yDLc5PAU=2rwa5ezL4emuL^qEwYNoQb zkm#_8lbnw-Sd^HBRF7%jchMuV?x*OfC{@TcFFt3yl|Ld0%A)$O64qi!_k7)Bd;DOz#pT_?6qaJZl9CwR^y|#$gN9j3KjbzgDo|{$mL2D zAM6Et{}WeZedQkb`2*ZKhk@XjVDbb?9;8^_(sitpex*A>Js7MhOr(E^tpWL1)|xfT z!RD4ZAgQA%i}zkT2PLZVQI2x*=Q~414oGA5jWN0?^Wu#PnJoMp7ylr$p0!D!+?&)k zF&=S?DHB89Ny@k0;Rk;RO3sUNsx~CdotvPJeJQg43s}Xku<-XmN!yq~1bdd&O|;E4 z$y@6N=mf=YW5(5+9SalbULwcu=-`M>E?XSeVfeXwnT3wxe$xJ1__=QBy2pYSa!=4; zfBK0b1MT^ z0JvkkrZ8J!>H2rMU;9JuJ8TvH;#Vb7A%m^WB%pXnAtaZXiT1Qvxsl5P> z7^Ku*nvN+>f+X|MHt5W036U`=a0Ve0`}*aYhZ_7C+jmmL#_f)v7T Date: Fri, 25 Jul 2025 08:25:39 +1000 Subject: [PATCH 3/4] updated sidebar --- astro.config.mjs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/astro.config.mjs b/astro.config.mjs index 3c30fa88..0de61a45 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -181,7 +181,12 @@ export default defineConfig({ }, { label: "Activities", - link: "book/part-0-getting-started/3-building-programs/3-explore", + collapsed: true, + autogenerate: { + directory: + "book/part-0-getting-started/3-building-programs/3-explore", + collapsed: true, + }, }, ], }, From 4066dc83f6956e8973cc4c813dd5dd8f06fb8eca Mon Sep 17 00:00:00 2001 From: "U-DESKTOP-RGBJJO6\\ybnvs" Date: Fri, 25 Jul 2025 13:48:06 +1000 Subject: [PATCH 4/4] Added energy score and solar visualiser TYK, updated Index page to include --- .../3-explore/03-0-explore.mdx | 2 + .../3-explore/03-4-energy-score.md | 38 ++++++++++ .../3-explore/03-5-solar-visualiser.md | 74 +++++++++++++++++++ 3 files changed, 114 insertions(+) create mode 100644 src/content/docs/book/part-1-instructions/1-sequence-and-data/3-explore/03-4-energy-score.md create mode 100644 src/content/docs/book/part-1-instructions/1-sequence-and-data/3-explore/03-5-solar-visualiser.md diff --git a/src/content/docs/book/part-1-instructions/1-sequence-and-data/3-explore/03-0-explore.mdx b/src/content/docs/book/part-1-instructions/1-sequence-and-data/3-explore/03-0-explore.mdx index d5b5da09..51541928 100644 --- a/src/content/docs/book/part-1-instructions/1-sequence-and-data/3-explore/03-0-explore.mdx +++ b/src/content/docs/book/part-1-instructions/1-sequence-and-data/3-explore/03-0-explore.mdx @@ -8,3 +8,5 @@ Having explored this leg of the journey you are now approaching a rest stop and - A [saving targets calculator](/book/part-1-instructions/1-sequence-and-data/3-explore/03-1-calculator). - A [music player](/book/part-1-instructions/1-sequence-and-data/3-explore/03-2-media-player) to load and play audio. - [Draw a scene](/book/part-1-instructions/1-sequence-and-data/3-explore/03-3-drawing) using SplashKit graphics. +- [Track your energy](/book/part-1-instructions/1-sequence-and-data/3-explore/03-4-energy-score) to get a daily energy rating +- [Draw a dashboard](/book/part-1-instructions/1-sequence-and-data/3-explore/03-5-solar-visualiser) to track home power usage diff --git a/src/content/docs/book/part-1-instructions/1-sequence-and-data/3-explore/03-4-energy-score.md b/src/content/docs/book/part-1-instructions/1-sequence-and-data/3-explore/03-4-energy-score.md new file mode 100644 index 00000000..2223b855 --- /dev/null +++ b/src/content/docs/book/part-1-instructions/1-sequence-and-data/3-explore/03-4-energy-score.md @@ -0,0 +1,38 @@ +--- +title: Daily Energy Score +sidebar: + label: " - Daily Energy Score" +--- + +:::tip +Use this task to explore how simple numbers and sequences can form the basis of more meaningful feedback tools. You can use the suggested energy formula below, or create your own variation based on a different domain (e.g. athletic recovery, study focus, game performance). +::: + +We can use sequence and data to simulate a basic wellbeing tool that calculates a daily “energy score” based on several lifestyle factors. This program will ask the user to enter scores from 1–10 for a few different areas, then calculate an overall energy level and display a summary message. + + +```txt +Welcome to your Daily Energy Score + +Rate your sleep quality (1–10): 7 +Rate your mental focus (1–10): 5 +Rate your physical activity (1–10): 6 +Rate your stress level (1–10): 3 + +Your energy score is: 25 out of 40 +That’s 62.5% +``` + +You can use this approach to calculate the final result: + +```txt +score = sleep + focus + activity + (10 - stress) +``` + +and + +```txt +percentage = (score / 40.0) * 100 +``` + +Or use an appropriate formula from your field! \ No newline at end of file diff --git a/src/content/docs/book/part-1-instructions/1-sequence-and-data/3-explore/03-5-solar-visualiser.md b/src/content/docs/book/part-1-instructions/1-sequence-and-data/3-explore/03-5-solar-visualiser.md new file mode 100644 index 00000000..c2bcded3 --- /dev/null +++ b/src/content/docs/book/part-1-instructions/1-sequence-and-data/3-explore/03-5-solar-visualiser.md @@ -0,0 +1,74 @@ +--- +title: Solar Visualiser +sidebar: + label: " - Solar Visualiser" +--- + +For this task you can build on the ideas from the [house drawing](/book/part-1-instructions/1-sequence-and-data/1-tour/02-00-house-drawing) tour. You may also find it useful to read about [drawing in SplashKit](/book/part-1-instructions/1-sequence-and-data/2-trailside/11-2-graphics/#drawing-to-a-window) and [playing sound effects in SplashKit](/book/part-1-instructions/1-sequence-and-data/2-trailside/11-3-audio) for this task. + +For this task, you will create a simple **solar panel visualiser** that helps the user understand how much of their power use is covered by solar over the course of a year. You will display a basic bar chart showing: + +- Monthly electricity **usage** +- Monthly **solar production** +- Any **shortfall** that needs to be purchased from the grid + +This is a great example of how data and visual feedback can be combined into a clear, useful display using just basic shapes and colour. + +--- + +### 🧮 How it works + +The user will input: +- Their **monthly electricity usage** in kilowatt hours (kWh) +- The **size of their solar system** in kW + +Your program will then: + +- Simulate monthly solar output using a seasonal efficiency curve (approximate Melbourne values): + +```txt +Jan = 1.0 (100%) +Feb = 0.95 +Mar = 0.85 +Apr = 0.75 +May = 0.60 +Jun = 0.50 +Jul = 0.50 +Aug = 0.60 +Sep = 0.75 +Oct = 0.85 +Nov = 0.95 +Dec = 1.0 +``` + +- Multiply the solar size by the monthly efficiency and an average output factor (e.g. 4.0 kWh per kW per day × days in month) to get total production +- Compare solar vs usage +- Draw three bars for each month: +- **Blue bar** for usage +- **Green bar** for solar output +- **Red bar** only if solar < usage (i.e. unmet demand) + +### ✏️ Example + +```txt +Welcome to the Solar Visualiser + +Enter your average monthly power usage (kWh): 600 +Enter your solar system size (kW): 5 + +Drawing results... +``` + +A window should then open showing 12 months as columns. Each column will have: + +- A blue rectangle showing usage +- A green rectangle showing solar output +- A red rectangle on top if the user needs to buy extra energy + +Make sure you draw at least 3 types of shapes and use calculated values from the user input and seasonal efficiency. + +:::caution + +Don't focus too much on making it pretty! The key learning here is sequence and data. + +:::