Skip to content

Commit de3a781

Browse files
authored
Merge pull request #23 from nemanjam/feature/maze-solver
Maze solver article
2 parents e03127d + 3651c1e commit de3a781

13 files changed

+503
-26
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232
"dc:up": "docker compose up --build --force-recreate -d"
3333
},
3434
"dependencies": {
35-
"@astrojs/mdx": "^4.3.2",
35+
"@astrojs/mdx": "^4.3.3",
3636
"@astrojs/partytown": "^2.1.4",
3737
"@astrojs/react": "^4.3.0",
3838
"@astrojs/sitemap": "^3.4.2",
3939
"@astrojs/tailwind": "^5.1.5",
4040
"@fontsource-variable/inter": "^5.2.6",
41-
"astro": "^5.12.7",
41+
"astro": "^5.12.8",
4242
"astro-embed": "^0.9.0",
4343
"astro-expressive-code": "^0.41.3",
4444
"astro-icon": "^1.1.5",

src/constants/collections.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export const COLLECTIONS = {
1313
PROJECT: 'project',
1414
} as const;
1515

16+
/** technologies */
1617
export const TAGS = [
1718
'next.js',
1819
'react',
@@ -25,20 +26,18 @@ export const TAGS = [
2526
'docker',
2627
'self-hosting',
2728
'algorithms',
29+
'computer-science',
2830
] as const;
2931

3032
/** adjust this later */
33+
/** form of an article, no technologies */
3134
export const CATEGORIES = [
3235
// add color here
3336
// extract find function
3437
{
3538
name: 'tutorials',
3639
icon: 'mdi:teach',
3740
},
38-
{
39-
name: 'computer-science',
40-
icon: 'mdi:chip',
41-
},
4241
{
4342
name: 'homelab',
4443
icon: 'mdi:flask-empty-outline',
129 KB
Loading
163 KB
Loading
79.6 KB
Loading
37.7 KB
Loading
76.3 KB
Loading

src/content/post/2025/07-31-maze-solver/_resources/index-devto.md

Whitespace-only changes.

src/content/post/2025/07-31-maze-solver/_resources/index-hashnode.md

Whitespace-only changes.
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
<mxfile host="app.diagrams.net" agent="Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0" version="24.7.17">
2+
<diagram name="Page-1" id="c4acf3e9-155e-7222-9cf6-157b1a14988f">
3+
<mxGraphModel dx="1497" dy="786" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="0" pageScale="1" pageWidth="850" pageHeight="1100" background="none" math="0" shadow="0">
4+
<root>
5+
<mxCell id="0" />
6+
<mxCell id="1" parent="0" />
7+
<mxCell id="17acba5748e5396b-1" value="Maze solver" style="shape=umlFrame;whiteSpace=wrap;html=1;rounded=0;shadow=0;comic=0;labelBackgroundColor=none;strokeWidth=1;fontFamily=Verdana;fontSize=10;align=center;width=120;height=30;direction=west;flipV=1;flipH=1;" parent="1" vertex="1">
8+
<mxGeometry width="1080" height="630" as="geometry" />
9+
</mxCell>
10+
<mxCell id="5d2195bd80daf111-39" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;dashed=1;labelBackgroundColor=none;startFill=0;endArrow=open;endFill=0;endSize=10;fontFamily=Verdana;fontSize=10;" parent="1" edge="1">
11+
<mxGeometry relative="1" as="geometry">
12+
<mxPoint x="730" y="978" as="targetPoint" />
13+
</mxGeometry>
14+
</mxCell>
15+
<mxCell id="5d2195bd80daf111-35" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;dashed=1;labelBackgroundColor=none;startFill=0;endArrow=open;endFill=0;endSize=10;fontFamily=Verdana;fontSize=10;" parent="1" edge="1">
16+
<mxGeometry relative="1" as="geometry">
17+
<Array as="points">
18+
<mxPoint x="545" y="970" />
19+
<mxPoint x="545" y="970" />
20+
</Array>
21+
<mxPoint x="544.9999999999995" y="963" as="sourcePoint" />
22+
</mxGeometry>
23+
</mxCell>
24+
<mxCell id="5d2195bd80daf111-34" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;dashed=1;labelBackgroundColor=none;startFill=0;endArrow=open;endFill=0;endSize=10;fontFamily=Verdana;fontSize=10;" parent="1" edge="1">
25+
<mxGeometry relative="1" as="geometry">
26+
<Array as="points">
27+
<mxPoint x="410" y="1029" />
28+
<mxPoint x="410" y="1029" />
29+
</Array>
30+
<mxPoint x="380" y="1029.090909090909" as="sourcePoint" />
31+
</mxGeometry>
32+
</mxCell>
33+
<mxCell id="5d2195bd80daf111-18" value="&lt;p style=&quot;margin:0px;margin-top:4px;text-align:center;&quot;&gt;&lt;i&gt;&amp;lt;&amp;lt;Interface&amp;gt;&amp;gt;&lt;/i&gt;&lt;br&gt;&lt;b&gt;IMaze&lt;/b&gt;&lt;/p&gt;&lt;hr size=&quot;1&quot;&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;+ getStart(): Coordinate &lt;/p&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;+ getCost(coord: Coordinate): number&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;+ formatPath(path: ReadonlyArray&amp;lt;Coordinate&amp;gt;): string&lt;/p&gt;" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;rounded=0;shadow=0;comic=0;labelBackgroundColor=none;strokeWidth=1" parent="1" vertex="1">
34+
<mxGeometry x="42" y="80" width="310" height="100" as="geometry" />
35+
</mxCell>
36+
<mxCell id="5d2195bd80daf111-19" value="&lt;p style=&quot;margin:0px;margin-top:4px;text-align:center;&quot;&gt;&lt;i&gt;&amp;lt;&amp;lt;Interface&amp;gt;&amp;gt;&lt;/i&gt;&lt;br&gt;&lt;b&gt;IMazeSolver&lt;/b&gt;&lt;/p&gt;&lt;hr size=&quot;1&quot;&gt;&amp;nbsp;+ solve(): string &lt;br&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;+ solveAndFormat(): FormattedResult&lt;/p&gt;" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;rounded=0;shadow=0;comic=0;labelBackgroundColor=none;strokeWidth=1" parent="1" vertex="1">
37+
<mxGeometry x="561" y="80" width="220" height="90" as="geometry" />
38+
</mxCell>
39+
<mxCell id="gK6vRJrWsyUHmA_Xx5b--3" value="Maze" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
40+
<mxGeometry x="40" y="241" width="420" height="170" as="geometry">
41+
<mxRectangle x="60" y="270" width="100" height="30" as="alternateBounds" />
42+
</mxGeometry>
43+
</mxCell>
44+
<mxCell id="gK6vRJrWsyUHmA_Xx5b--4" value="&lt;div&gt;- board: number[][] &lt;br&gt;&lt;/div&gt;&lt;div&gt;- start: Coordinate&lt;/div&gt;&lt;div&gt;- end: Coordinate &lt;/div&gt;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="gK6vRJrWsyUHmA_Xx5b--3" vertex="1">
45+
<mxGeometry y="30" width="420" height="60" as="geometry" />
46+
</mxCell>
47+
<mxCell id="gK6vRJrWsyUHmA_Xx5b--5" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" parent="gK6vRJrWsyUHmA_Xx5b--3" vertex="1">
48+
<mxGeometry y="90" width="420" height="10" as="geometry" />
49+
</mxCell>
50+
<mxCell id="gK6vRJrWsyUHmA_Xx5b--6" value="&lt;div&gt;+ static create(board: number[][], start: Coordinate, end: Coordinate): Maze&lt;/div&gt;&lt;div&gt;+ getStart(): Coordinate &lt;/div&gt;&lt;div&gt;+ getCost(coord: Coordinate): number &lt;br&gt;&lt;/div&gt;&lt;div&gt;+ formatPath(path: ReadonlyArray&amp;lt;Coordinate&amp;gt;): string&lt;/div&gt;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="gK6vRJrWsyUHmA_Xx5b--3" vertex="1">
51+
<mxGeometry y="100" width="420" height="70" as="geometry" />
52+
</mxCell>
53+
<mxCell id="gK6vRJrWsyUHmA_Xx5b--13" value="MazeSolver" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
54+
<mxGeometry x="561" y="241" width="479" height="136" as="geometry" />
55+
</mxCell>
56+
<mxCell id="gK6vRJrWsyUHmA_Xx5b--14" value="&lt;div&gt;- maze: IMaze&lt;/div&gt;- enableLogging: boolean" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="gK6vRJrWsyUHmA_Xx5b--13" vertex="1">
57+
<mxGeometry y="26" width="479" height="40" as="geometry" />
58+
</mxCell>
59+
<mxCell id="gK6vRJrWsyUHmA_Xx5b--15" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" parent="gK6vRJrWsyUHmA_Xx5b--13" vertex="1">
60+
<mxGeometry y="66" width="479" height="10" as="geometry" />
61+
</mxCell>
62+
<mxCell id="gK6vRJrWsyUHmA_Xx5b--16" value="&lt;div&gt;# abstract findPath(): Coordinate[] | null&lt;/div&gt;&lt;div&gt;+ solve(): string &lt;/div&gt;&lt;div&gt;+ printBoard(current: Coordinate, visited: Set&amp;lt;string&amp;gt;, currentPath: Coordinate[]): void&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="gK6vRJrWsyUHmA_Xx5b--13" vertex="1">
63+
<mxGeometry y="76" width="479" height="60" as="geometry" />
64+
</mxCell>
65+
<mxCell id="gK6vRJrWsyUHmA_Xx5b--19" value="MazeSolverBFS" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
66+
<mxGeometry x="440" y="470" width="190" height="56" as="geometry" />
67+
</mxCell>
68+
<mxCell id="gK6vRJrWsyUHmA_Xx5b--22" value="# findPath(): Coordinate[] | null " style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="gK6vRJrWsyUHmA_Xx5b--19" vertex="1">
69+
<mxGeometry y="26" width="190" height="30" as="geometry" />
70+
</mxCell>
71+
<mxCell id="gK6vRJrWsyUHmA_Xx5b--26" value="MazeSolverDFS" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
72+
<mxGeometry x="600" y="540" width="190" height="56" as="geometry" />
73+
</mxCell>
74+
<mxCell id="gK6vRJrWsyUHmA_Xx5b--27" value="# findPath(): Coordinate[] | null " style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="gK6vRJrWsyUHmA_Xx5b--26" vertex="1">
75+
<mxGeometry y="26" width="190" height="30" as="geometry" />
76+
</mxCell>
77+
<mxCell id="gK6vRJrWsyUHmA_Xx5b--12" value="" style="endArrow=block;dashed=1;endFill=0;endSize=12;html=1;rounded=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.369;exitY=0.004;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" edge="1">
78+
<mxGeometry width="160" relative="1" as="geometry">
79+
<mxPoint x="199.9799999999999" y="241.68000000000006" as="sourcePoint" />
80+
<mxPoint x="200" y="180" as="targetPoint" />
81+
</mxGeometry>
82+
</mxCell>
83+
<mxCell id="gK6vRJrWsyUHmA_Xx5b--18" value="" style="endArrow=block;dashed=1;endFill=0;endSize=12;html=1;rounded=0;entryX=0.539;entryY=1.008;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.248;exitY=-0.001;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="gK6vRJrWsyUHmA_Xx5b--13" target="5d2195bd80daf111-19" edge="1">
84+
<mxGeometry width="160" relative="1" as="geometry">
85+
<mxPoint x="621.96" y="230" as="sourcePoint" />
86+
<mxPoint x="618.9999999999999" y="177.18" as="targetPoint" />
87+
</mxGeometry>
88+
</mxCell>
89+
<mxCell id="gK6vRJrWsyUHmA_Xx5b--32" value="MazeSolverDijkstra" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
90+
<mxGeometry x="730" y="470" width="190" height="56" as="geometry" />
91+
</mxCell>
92+
<mxCell id="gK6vRJrWsyUHmA_Xx5b--34" value="# findPath(): Coordinate[] | null " style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="gK6vRJrWsyUHmA_Xx5b--32" vertex="1">
93+
<mxGeometry y="26" width="190" height="30" as="geometry" />
94+
</mxCell>
95+
<mxCell id="gK6vRJrWsyUHmA_Xx5b--35" value="&lt;div&gt;MazeSolverAStar&lt;/div&gt;" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
96+
<mxGeometry x="850" y="540" width="190" height="56" as="geometry" />
97+
</mxCell>
98+
<mxCell id="gK6vRJrWsyUHmA_Xx5b--36" value="Extends" style="endArrow=block;endSize=16;endFill=0;html=1;rounded=0;entryX=0.832;entryY=1.005;entryDx=0;entryDy=0;entryPerimeter=0;" parent="gK6vRJrWsyUHmA_Xx5b--35" target="gK6vRJrWsyUHmA_Xx5b--16" edge="1">
99+
<mxGeometry width="160" relative="1" as="geometry">
100+
<mxPoint x="110" as="sourcePoint" />
101+
<mxPoint x="110" y="-172" as="targetPoint" />
102+
</mxGeometry>
103+
</mxCell>
104+
<mxCell id="gK6vRJrWsyUHmA_Xx5b--37" value="# findPath(): Coordinate[] | null " style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="gK6vRJrWsyUHmA_Xx5b--35" vertex="1">
105+
<mxGeometry y="26" width="190" height="30" as="geometry" />
106+
</mxCell>
107+
<mxCell id="gK6vRJrWsyUHmA_Xx5b--38" value="Use" style="endArrow=open;endSize=12;dashed=1;html=1;rounded=0;entryX=-0.001;entryY=0.367;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.998;exitY=0.201;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="gK6vRJrWsyUHmA_Xx5b--4" target="gK6vRJrWsyUHmA_Xx5b--14" edge="1">
108+
<mxGeometry width="160" relative="1" as="geometry">
109+
<mxPoint x="459" y="278" as="sourcePoint" />
110+
<mxPoint x="509" y="280" as="targetPoint" />
111+
</mxGeometry>
112+
</mxCell>
113+
<mxCell id="gK6vRJrWsyUHmA_Xx5b--40" value="" style="group" parent="1" vertex="1" connectable="0">
114+
<mxGeometry x="821" y="470" as="geometry" />
115+
</mxCell>
116+
<mxCell id="gK6vRJrWsyUHmA_Xx5b--24" value="Extends" style="endArrow=block;endSize=16;endFill=0;html=1;rounded=0;entryX=0.028;entryY=1.001;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.704;exitY=0.009;exitDx=0;exitDy=0;exitPerimeter=0;movable=1;resizable=1;rotatable=1;deletable=1;editable=1;locked=0;connectable=1;" parent="gK6vRJrWsyUHmA_Xx5b--40" source="gK6vRJrWsyUHmA_Xx5b--19" target="gK6vRJrWsyUHmA_Xx5b--16" edge="1">
117+
<mxGeometry width="160" relative="1" as="geometry">
118+
<mxPoint x="-225.01999999999998" y="-10.79200000000003" as="sourcePoint" />
119+
<mxPoint x="-219.36000000000013" y="-101.05399999999997" as="targetPoint" />
120+
</mxGeometry>
121+
</mxCell>
122+
<mxCell id="gK6vRJrWsyUHmA_Xx5b--29" value="Extends" style="endArrow=block;endSize=16;endFill=0;html=1;rounded=0;entryX=0.196;entryY=1.003;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.291;exitY=0.001;exitDx=0;exitDy=0;exitPerimeter=0;" parent="gK6vRJrWsyUHmA_Xx5b--40" edge="1">
123+
<mxGeometry width="160" relative="1" as="geometry">
124+
<mxPoint x="-140.7099999999998" y="70.05600000000004" as="sourcePoint" />
125+
<mxPoint x="-141.11599999999999" y="-92.82000000000005" as="targetPoint" />
126+
</mxGeometry>
127+
</mxCell>
128+
<mxCell id="gK6vRJrWsyUHmA_Xx5b--33" value="Extends" style="endArrow=block;endSize=16;endFill=0;html=1;rounded=0;entryX=0.544;entryY=1.006;entryDx=0;entryDy=0;entryPerimeter=0;" parent="gK6vRJrWsyUHmA_Xx5b--40" target="gK6vRJrWsyUHmA_Xx5b--16" edge="1">
129+
<mxGeometry width="160" relative="1" as="geometry">
130+
<mxPoint as="sourcePoint" />
131+
<mxPoint x="12.040000000000077" y="-100.74399999999997" as="targetPoint" />
132+
</mxGeometry>
133+
</mxCell>
134+
</root>
135+
</mxGraphModel>
136+
</diagram>
137+
</mxfile>

0 commit comments

Comments
 (0)