This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Just a utility function I thought of you could use it for some graph problem, or if you are building a board state for minesweeper | |
// or for whatever you need..... | |
function create2DArray(n,fillWith) { | |
return Array.from({length:n},()=>Array.from({length:n},()=>fillWith)); | |
} | |
// Usage create2DArray(2,0) | |
/* | |
[ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script lang="ts"> | |
import { onDestroy, onMount } from 'svelte'; | |
import { browser } from '$app/environment'; | |
import type { editor } from 'monaco-editor'; | |
const extensions = { | |
json: ['json'], | |
css: ['css', 'less', 'scss'], | |
js: ['typescript', 'javascript'], | |
html: ['html', 'razor', 'handlebars'] | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
import { onMount } from "svelte"; | |
import editorWorker from "monaco-editor/esm/vs/editor/editor.worker?worker"; | |
import jsonWorker from "monaco-editor/esm/vs/language/json/json.worker?worker"; | |
import cssWorker from "monaco-editor/esm/vs/language/css/css.worker?worker"; | |
import htmlWorker from "monaco-editor/esm/vs/language/html/html.worker?worker"; | |
import tsWorker from "monaco-editor/esm/vs/language/typescript/ts.worker?worker"; | |
let subscriptions = []; | |
export let content; |