binary to decimal
This commit is contained in:
@@ -7,12 +7,12 @@ export interface Topic {
|
||||
}
|
||||
|
||||
export interface Unit {
|
||||
number: 1 | 2 | 3 | 4 | 5;
|
||||
number: 1 | 2 | 3 | 4 | 5 | 6;
|
||||
slug: string;
|
||||
title: string;
|
||||
description: string;
|
||||
weeks: string;
|
||||
color: "unit-1" | "unit-2" | "unit-3" | "unit-4" | "unit-5";
|
||||
color: "unit-1" | "unit-2" | "unit-3" | "unit-4" | "unit-5" | "unit-6";
|
||||
topics: Topic[];
|
||||
}
|
||||
|
||||
@@ -200,6 +200,23 @@ export const curriculum: Unit[] = [
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
number: 6,
|
||||
slug: "unit-6-number-system",
|
||||
title: "Number System",
|
||||
description: "Explore how numbers can be written in different bases, beyond the everyday denary system",
|
||||
weeks: "Week 10",
|
||||
color: "unit-6",
|
||||
topics: [
|
||||
{
|
||||
slug: "binary",
|
||||
title: "Binary Numbers",
|
||||
shortTitle: "Binary",
|
||||
week: 10,
|
||||
description: "Place value in base 2 and converting binary numbers to denary (decimal)",
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export function getUnit(slug: string): Unit | undefined {
|
||||
@@ -211,13 +228,14 @@ export function getTopic(unitSlug: string, topicSlug: string): Topic | undefined
|
||||
return unit?.topics.find((t) => t.slug === topicSlug);
|
||||
}
|
||||
|
||||
export function getUnitColor(unitNumber: 1 | 2 | 3 | 4 | 5): string {
|
||||
export function getUnitColor(unitNumber: 1 | 2 | 3 | 4 | 5 | 6): string {
|
||||
const colors = {
|
||||
1: "unit-1",
|
||||
2: "unit-2",
|
||||
3: "unit-3",
|
||||
4: "unit-4",
|
||||
5: "unit-5",
|
||||
6: "unit-6",
|
||||
};
|
||||
return colors[unitNumber];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user