Added more problems
This commit is contained in:
+3
-3
@@ -108,17 +108,17 @@ export function activate(context: vscode.ExtensionContext) {
|
|||||||
quickPick.onDidAccept(async () => {
|
quickPick.onDidAccept(async () => {
|
||||||
const selection = quickPick.selectedItems[0];
|
const selection = quickPick.selectedItems[0];
|
||||||
if (selection) {
|
if (selection) {
|
||||||
const name = selection.label.toLowerCase();
|
const name = selection.label.toLowerCase().replace(' ', '-');
|
||||||
treeDataProvider.testSummary = undefined;
|
treeDataProvider.testSummary = undefined;
|
||||||
treeDataProvider.testResults = [];
|
treeDataProvider.testResults = [];
|
||||||
treeDataProvider.blunders = [];
|
treeDataProvider.blunders = [];
|
||||||
treeDataProvider.refresh();
|
treeDataProvider.refresh();
|
||||||
const runFilePath = path.join(speedCodePath, name + ".js");
|
const runFilePath = path.join(speedCodePath, name.replace('-', '_') + ".js");
|
||||||
fs.writeFileSync(runFilePath, "");
|
fs.writeFileSync(runFilePath, "");
|
||||||
openAndFocusFile(runFilePath);
|
openAndFocusFile(runFilePath);
|
||||||
|
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
`https://raw.githubusercontent.com/SpeedCodeHQ/problems/refs/heads/main/${name}.json`
|
`https://raw.githubusercontent.com/SpeedCodeHQ/problems/refs/heads/main/problems/${name}.json`
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
export const problems = ["Palindrome"];
|
export const problems = ["Two Sum", "Palindrome", "Fibonacci", "Factorial", "Find Missing Number", "Anagram", "Reverse Words In a Sentence"];
|
||||||
|
|
||||||
export function format(timeSeconds: number): string {
|
export function format(timeSeconds: number): string {
|
||||||
if (timeSeconds > 86400) {
|
if (timeSeconds > 86400) {
|
||||||
|
|||||||
Reference in New Issue
Block a user