By the end of Task 2 you have two charts of the same five numbers: how many matches each hero in a game has won. In the top chart the heroes look evenly matched. In the bottom one, Rogue looks like it wins ten times as often as Archer.

Task 2: one dataset, two stories
Neither chart is lying. Every bar is the right height for its own scale, and every bar has its real number under it. One number in one line of code separates them.
Task 3 is not shown. That one is yours to work out.
'F' → Fullscreen
The game studio's balance team is arguing about whether the Rogue hero is too strong, and they want a chart for tomorrow's meeting. Create a new Raylib program named 2-20-win-chart.
How to read the code blocks. Each task's code block shows your whole program, from line 1, as it should look when that task is finished.
The green lines marked with a + are the ones you add or change for that task — everything else is already in your file. Do not type the + sign.
This lab needs the workspace, not Juicemind. Close the window to end the program. Escape works too.
DrawChart first finds the biggest win count, then draws one bar per hero. Every bar is up to 140 pixels tall, and its height is worked out by this line:height = (value - baseline) * 140 / (biggest - baseline)
baseline 0 a bar's height is its share of the biggest valuebaseline 380 a bar's height is its share of the part above 380412 / 455 is 0, so dividing first would make every bar but the biggest 0 pixels tall.DrawChart takes three parameters. Name each one and say what changes when you change it.biggest. Then put 455 back.#:package Raylib-cs@8.0.0
using Raylib_cs;
string[] heroes = { "Knight", "Archer", "Mage", "Rogue", "Bard" };int[] wins = { 412, 388, 401, 455, 423 };
Raylib.InitWindow(800, 460, "Win Chart");Raylib.SetTargetFPS(60);
while (!Raylib.WindowShouldClose()){ Raylib.BeginDrawing(); Raylib.ClearBackground(new Color(24, 26, 34, 255));
DrawChart(0, 10, "Wins, counting from 0");
Raylib.EndDrawing();}
Raylib.CloseWindow();
void DrawChart(int baseline, int top, string title){ int biggest = 0;
for (int i = 0; i < wins.Length; i++) { if (wins[i] > biggest) { biggest = wins[i]; } }
Raylib.DrawText(title, 60, top, 20, Color.White);
for (int i = 0; i < wins.Length; i++) { int height = (wins[i] - baseline) * 140 / (biggest - baseline); int x = 60 + i * 140;
Raylib.DrawRectangle(x, top + 170 - height, 100, height, Color.SkyBlue); Raylib.DrawText(heroes[i], x, top + 176, 16, Color.LightGray); Raylib.DrawText($"{wins[i]}", x, top + 194, 16, Color.LightGray); }}#:package Raylib-cs@8.0.0
using Raylib_cs;
string[] heroes = { "Knight", "Archer", "Mage", "Rogue", "Bard" };int[] wins = { 412, 388, 401, 455, 423 };
Raylib.InitWindow(800, 460, "Win Chart");Raylib.SetTargetFPS(60);
while (!Raylib.WindowShouldClose()){ Raylib.BeginDrawing(); Raylib.ClearBackground(new Color(24, 26, 34, 255));
DrawChart(0, 10, "Wins, counting from 0"); DrawChart(380, 240, "Wins, counting from 380");
Raylib.EndDrawing();}
Raylib.CloseWindow();
void DrawChart(int baseline, int top, string title){ int biggest = 0;
for (int i = 0; i < wins.Length; i++) { if (wins[i] > biggest) { biggest = wins[i]; } }
Raylib.DrawText(title, 60, top, 20, Color.White);
for (int i = 0; i < wins.Length; i++) { int height = (wins[i] - baseline) * 140 / (biggest - baseline); int x = 60 + i * 140;
Raylib.DrawRectangle(x, top + 170 - height, 100, height, Color.SkyBlue); Raylib.DrawText(heroes[i], x, top + 176, 16, Color.LightGray); Raylib.DrawText($"{wins[i]}", x, top + 194, 16, Color.LightGray); }}DrawChart, find its height with the same formula as a bar, and draw a rectangle two pixels tall across the chart at that height.Both pictures are screenshots of this page's own programs.

Task 1

Task 2
DrawChart's three parameters and explained why the bars shrankAnswer the following questions before submitting your work.
Submit four things to the dropbox: