Skip to content

Commit

Permalink
publish
Browse files Browse the repository at this point in the history
  • Loading branch information
mxgmn committed Jun 1, 2022
1 parent 36c337f commit 222cd2e
Show file tree
Hide file tree
Showing 458 changed files with 9,231 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [mxgmn]
14 changes: 14 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cff-version: 1.1.0
message: "citation"
authors:
- family-names: Gumin
given-names: Maxim
title: MarkovJunior, a probabilistic programming language based on pattern matching and constraint propagation
version: 1.0
date-released: 2022-06-01
keywords:
- probabilistic programming
- procedural generation
- constraint satisfaction
- language
url: https://github.com/mxgmn/MarkovJunior
14 changes: 14 additions & 0 deletions MarkovJunior.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Drawing.Common" Version="4.5.1" />
</ItemGroup>

</Project>
242 changes: 242 additions & 0 deletions README.md

Large diffs are not rendered by default.

Binary file added images/Apartemazements.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Basic.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Circuit.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/CompleteSAW.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/DungeonGrowth.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Flowers.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Growth.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/LoopErasedWalk.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/MazeBacktracker.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/MazeGrowth.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/MazeGrowth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/NystromDungeon.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/RegularSAW.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/River.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/SokobanLevel1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/StairsPath.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Trail.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Wilson.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cold.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/coldest.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/hot.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/hottest.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/multisokoban.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/palette.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ps-for-procgen.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/top-1764.png
Binary file added images/top-882.png
Binary file added images/top-iso.gif
Binary file added images/top-mv.gif
167 changes: 167 additions & 0 deletions models.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
<models>
<model name="Apartemazements" size="8" d="3" amount="4"/>
<model name="Apartemazements" size="8" d="3" iso="True" pixelsize="6" gui="150"/>
<model name="CarmaTower" length="12" width="12" height="18"/>
<model name="CarmaTower" length="12" width="12" height="18" iso="True" amount="1"/>
<model name="ModernHouse" length="9" width="9" height="4" amount="4"/>
<model name="ModernHouse" length="9" width="9" height="4" iso="True"/>
<model name="SeaVilla" length="10" width="10" height="4" amount="4"/>
<model name="SeaVilla" length="10" width="10" height="4" iso="True"/>

<model name="Backtracker" size="89"/>
<model name="BacktrackerCycle" size="59"/>
<model name="Basic" size="60" steps="1000"/>
<model name="BasicBrickWall" size="30"/>
<model name="BasicDijkstraDungeon" size="60"/>
<model name="BasicDijkstraFill" size="60"/>
<model name="BasicDungeonGrowth" size="59"/>
<model name="BasicPartitioning" size="60" steps="1000"/>
<model name="BernoulliPercolation" size="359"/>
<model name="BiasedGrowth" size="120" steps="1000"/>
<model name="BiasedGrowthContraction" size="120" steps="5000"/>
<model name="BiasedMazeGrowth" size="117" steps="400"/>
<model name="BiasedVoronoi" size="80" steps="1000"/>
<model name="BishopParity" size="60"/>
<model name="BlueNoise" size="80" steps="500"/>
<model name="Cave" size="60"/>
<model name="CaveContour" size="80"/>
<model name="CentralCrawlers" size="60" steps="300"/>
<model name="CentralSAW" size="59"/>
<model name="ChainDungeon" size="60"/>
<model name="ChainDungeonMaze" size="60"/>
<model name="ChainMaze" size="60"/>
<model name="Circuit" size="59" steps="1200"/>
<model name="ClosedSurface" size="12" d="3"/>
<model name="ColoredKnots" size="12" d="3"/>
<model name="CompleteSAW" size="19"/>
<model name="CompleteSAWSmart" size="23"/>
<model name="ConnectedCaves" size="60"/>
<model name="ConstrainedCaves" size="60"/>
<model name="Counting" size="8" d="3"/>
<model name="Coupling" size="80"/>
<model name="CrawlersChase" size="60" steps="200"/>
<model name="CrossCountry" size="80"/>
<model name="Cycles" size="59"/>
<model name="DenseSAW" size="59" amount="4"/>
<model name="DiagonalPath" size="80"/>
<model name="Digger" size="359" steps="50000"/>
<model name="DijkstraDungeon" size="40" amount="4"/>
<model name="DualRetraction" size="59"/>
<model name="DualRetraction3D" size="27" d="3"/>
<model name="DungeonGrowth" size="79" amount="4"/>
<model name="Dwarves" size="20" steps="85"/>
<model name="Escher" size="8" d="3"/>
<model name="EscherSurface" size="8" d="3"/>
<model name="EuclideanPath" size="80"/>
<model name="FindLongCycle" size="27" pixelsize="10"/>
<model name="FireNoise" size="300"/>
<model name="Flowers" size="60"/>
<model name="ForestFire" size="600" steps="80" pixelsize="1"/>
<model name="ForestFireCA" size="600" steps="80" pixelsize="1"/>
<model name="GameOfLife" size="120" steps="100"/>
<model name="Growth" size="359" steps="40000"/>
<model name="Growth" size="29" d="3" steps="3000"/>
<model name="GrowthCompetition" size="80" steps="30000"/>
<model name="GrowthContraction" size="79" steps="10000"/>
<model name="GrowthWalk" size="79" steps="5000"/>
<model name="GrowTo" size="120" steps="2000"/>
<model name="HamiltonianPath" size="39" steps="150000"/>
<model name="HamiltonianPaths" size="39" steps="1000"/>
<model name="Hills" length="40" width="40" height="12" d="3"/>
<model name="IrregularMazeGrowth" size="79"/>
<model name="IrregularSAW" size="79"/>
<model name="Keys" size="33"/>
<model name="Keys" size="23" d="3"/>
<model name="KnightPatrol" size="60" steps="200"/>
<model name="Knots2D" size="12"/>
<model name="Knots3D" size="8" d="3"/>
<model name="Laplace" size="60" steps="1000"/>
<model name="LoopGrowth" size="37"/>
<model name="MarchingSquares" size="20"/>
<model name="MazeBacktracker" size="359" steps="20000"/>
<model name="MazeBacktracker" size="967" pixelsize="1" steps="200000"/>
<model name="MazeGrowth" size="359"/>
<model name="MazeGrowth" size="27" d="3"/>
<model name="MazeMap" size="30"/>
<model name="MazeTrail" size="59" steps="1000"/>
<model name="MazeTrail" size="27" d="3" steps="1000"/>
<model name="NestedGrowth" size="80" steps="100"/>
<model name="NoDeadEnds" size="39"/>
<model name="NoDeadEnds" size="19" d="3"/>
<model name="Noise" size="80"/>
<model name="Noise" size="24" d="3"/>
<model name="NystromDungeon" size="39" amount="4" pixelsize="8" gui="150"/>
<model name="OddScale" size="8"/>
<model name="OddScale3D" size="8" d="3"/>
<model name="OpenCave" size="80"/>
<model name="OpenCave3D" size="40" d="3"/>
<model name="OrganicMechanic" size="30" steps="200"/>
<model name="OrientedEscher" size="6" d="3"/>
<model name="PaintCompetition" size="48" steps="400"/>
<model name="ParallelGrowth" size="29" d="3" steps="24"/>
<model name="ParallelMazeGrowth" size="179"/>
<model name="Partitioning" length="11" width="11" height="3"/>
<model name="Percolation" size="360"/>
<model name="PeriodicEscher" size="8" d="3"/>
<model name="PillarsOfEternity" size="9" d="3"/>
<model name="Push" size="40" steps="8000"/>
<model name="PutColoredLs" size="30"/>
<model name="PutLs" size="50"/>
<model name="RegularPath" size="79"/>
<model name="RegularSAW" size="39"/>
<model name="RegularSAW" size="19" d="3"/>
<model name="RegularSAWRestart" size="39"/>
<model name="RegularSAWRestart" size="19" d="3"/>
<model name="River" size="80" amount="4"/>
<model name="River" size="20" d="3" amount="1"/>
<model name="SAWRestart" size="79" steps="2000"/>
<model name="SelectLargeCaves" size="60"/>
<model name="SelectLongKnots" size="10" d="3"/>
<model name="SelfAvoidingWalk" size="39"/>
<model name="Sewers" size="40"/>
<model name="SmarterDigger" size="40" steps="800"/>
<model name="SmartSAW" size="19"/>
<model name="SmoothTrail" size="59"/>
<model name="SnellLaw" size="80"/>
<model name="SoftPath" size="180"/>
<model name="SoftPath" size="80" d="3"/>
<model name="StairsPath" size="33" d="3"/>
<model name="StochasticVoronoi" size="200"/>
<model name="StochasticVoronoi" size="50" d="3" steps="-1"/>
<model name="StormySnellLaw" size="120"/>
<model name="StrangeNoise" size="60" steps="500"/>
<model name="StrangeDungeon" size="59"/>
<model name="StrangeDungeon" size="29" d="3"/>
<model name="StrangeGrowth" size="59" steps="700"/>
<model name="SubmergedKnots" size="12" d="3"/>
<model name="Surface" size="10" d="3"/>
<model name="Tetris" size="30" steps="1500"/>
<model name="TileDungeon" size="12" amount="4"/>
<model name="Trail" size="59" steps="3000"/>
<model name="Voronoi" size="240"/>
<model name="Voronoi" size="60" d="3"/>
<model name="WaveBrickWall" size="50"/>
<model name="WaveDungeon" size="50"/>
<model name="WaveFlowers" size="60"/>
<model name="WolfBasedApproach" size="70" steps="300"/>

gifs
<!--<model name="Wilson" size="59" steps="1000" gui="150" gif="True"/>-->
<!--<model name="BasicSnake" size="23" steps="100" gif="True"/>-->
<!--<model name="Chase" size="60" steps="200" gif="True"/>-->

<!--<model name="MultiSokoban9" size="9" amount="1" pixelsize="20" gif="True"/>-->
<!--<model name="MultiSokoban8" size="8" amount="1" pixelsize="20" gif="True"/>-->
<!--<model name="SokobanLevel1" length="14" width="9" amount="1" pixelsize="21" gif="True"/>-->
<!--<model name="SokobanLevel2" length="5" width="4" amount="1" pixelsize="21" gif="True"/>-->
<!--<model name="SequentialSokoban" size="20" gif="True"/>-->

benchmarks
<!--<model name="MazeGrowth" size="967" amount="20" pixelsize="1" steps="200000"/> 1.7-->
<!--<model name="ParallelMazeGrowth" size="967" amount="20" pixelsize="1"/> 2.0-->
<!--<model name="MazeBacktracker" size="967" amount="20" pixelsize="1" steps="200000"/> 2.3-->
</models>

<!--
-->
70 changes: 70 additions & 0 deletions models/Apartemazements.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<sequence values="BWN" symmetry="(xy)">
<prl in="B" out="W"/>
<prl in="***/***/*** ***/*W*/*** ***/***/***" out="***/***/*** ***/*B*/*** ***/***/***"/>
<prl in="B W" out="B N"/>
<wfc values="BYDAWP RFUENC" tileset="Paths">
<rule in="W" out="Empty"/>
<rule in="N" out="Empty|Line|Up|Turn|X"/>

<prl in="B" out="C" comment="draw earth"/>
<prl in="C * *" out="B * *" comment="remove extra earth"/>
<prl in="C C" out="E N" comment="draw grass"/>
<prl in="C" out="N"/>
<prl in="Y" out="C" p="0.25" steps="1"/>
<prl in="Y" out="B"/>

<all comment="draw columns">
<rule in="D B" out="* F"/>
<rule in="F B" out="* F"/>
</all>
<all comment="remove extra columns">
<rule in="FF EE" out="BB EE"/>
<rule in="FF FD EE" out="FF BD EE"/>
<rule in="F B" out="B B"/>
<rule in="B F" out="B B"/>
<rule in="F P" out="B P"/>
<rule in="P* *F" out="** *B"/>
</all>
<all comment="draw corner columns">
<rule in="*A*/ADB/*B* ***/*B*/***" out="***/***/*** ***/*F*/***"/>
<rule in="F B" out="F F"/>
</all>
<all comment="place windows">
<rule in="FBBBF *AAA*" out="*RRR* *****"/>
<rule in="FBBBF *RRR*" out="*RRR* *****"/>
</all>
<prl comment="find h-uneven windows">
<rule in="RFFR RFDA" out="U**U U***"/>
<rule in="RFDA RFFR" out="U*** U**U"/>
</prl>
<all comment="mark h-uneven windows">
<rule in="R U" out="U *"/>
<rule in="U R" out="* U"/>
</all>
<prl in="RFFR/BBBB" out="*RR*/****" comment="merge h-even windows"/>
<prl in="U" out="R" comment="erase markings"/>
<prl comment="find v-uneven windows">
<rule in="RR DA FR" out="UU ** *U"/>
<rule in="FR DA RR" out="*U ** UU"/>
</prl>
<all comment="mark v-uneven windows">
<rule in="RU" out="U*"/>
<rule in="UR" out="*U"/>
</all>
<prl comment="merge v-even windows">
<rule in="RB AB RB" out="RB RB RB"/>
<rule in="RB DB RB" out="RB RB RB"/>
</prl>
<prl comment="forget structure">
<rule in="F" out="A"/>
<rule in="D" out="A"/>
<rule in="P" out="A"/>
<rule in="U" out="R"/>
</prl>
<prl in="AAAAA ARRRA ARRRA ARRRA ARRRA AAAAA" out="AAAAA AAAAA AAAAA AAAAA AAAAA AAAAA"/>
</wfc>
</sequence>

<!--
Some rendered outputs: https://github.com/mxgmn/Blog/blob/master/Apartemazements.md
-->
10 changes: 10 additions & 0 deletions models/Backtracker.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<markov values="BRWU" origin="Center">
<one in="RB" out="WR"/>
<one in="RW" out="UR"/>
</markov>

<!--
Generates connected cave systems with pools.
(-) Can be accelerated by setting forgetPastMatches="True" in both nodes.
-->
16 changes: 16 additions & 0 deletions models/BacktrackerCycle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<sequence values="BRGWA" origin="Center">
<union symbol="?" values="WA"/>
<markov>
<one in="RBB" out="GGR"/>
<one in="RGG" out="WAR"/>
</markov>
<one in="R" out="W"/>
<one in="WBW" out="WAW" steps="1"/>
<all in="BBB/B?B" out="***/*B*" d="2"/>
<!--<all in="BBB/BBB/BBB BBB/B?B/BBB" out="***/***/*** ***/*B*/***" d="3"/>-->
<all in="A" out="W"/>
</sequence>

<!--
Generates a random cycle.
-->
1 change: 1 addition & 0 deletions models/Basic.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<one values="BW" in="B" out="W" origin="Center"/>
35 changes: 35 additions & 0 deletions models/BasicBrickWall.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<sequence values="BWO" symmetry="(x)">
<all in="B/*" out="O/*"/>
<all in="O/*/*" out="W/*/*"/>
<markov>
<all in="BW" out="BB"/>
<one in="W/W/W/W/W/W/W/W" out="*/*/*/B/*/*/*/*"/>
</markov>
<one in="OOOOOOOO/BBBBBBBB" out="***B****/********"/>
<markov>
<all in="OW" out="*O" symmetry="(xy)"/>
<all in="OO/OB" out="*B/**"/>
<one in="OOOO/BBBB/OOOO" out="**B*/****/****"/>
<one in="WW/BB/OB" out="*O/**/**"/>
</markov>
</sequence>

<!--
To make BrickWall, add texture and shading.
<sequence values="BWO" symmetry="(x)">
<prl in="B/*" out="O/*"/>
<prl in="O/*/*" out="W/*/*"/>
<markov>
<all in="BW" out="BB"/>
<one in="W/W/W/W/W/W/W/W" out="*/*/*/B/*/*/*/*"/>
</markov>
<one in="OOOOOOOO/BBBBBBBB" out="***B****/********"/>
<markov>
<all in="OW" out="*O" symmetry="(xy)"/>
<all in="OO/OB" out="*B/**"/>
<one in="OOOO/BBBB/OOOO" out="**B*/****/****"/>
<one in="WW/BB/OB" out="*O/**/**"/>
</markov>
</sequence>
-->
9 changes: 9 additions & 0 deletions models/BasicDijkstraDungeon.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<sequence values="BGW">
<one file="BasicDijkstraRoom" legend="BW" steps="1"/>
<all in="W" out="G"/>
<markov>
<all in="GW" out="GG"/>
<path from="W" to="G" on="B" color="G" inertia="True"/>
<one file="BasicDijkstraRoom" legend="BW"/>
</markov>
</sequence>
8 changes: 8 additions & 0 deletions models/BasicDijkstraFill.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<sequence values="BWG">
<all file="BasicDijkstraRoom" legend="BW"/>
<markov>
<all in="GW" out="GG"/>
<path from="G" to="W" on="B" color="G" inertia="True"/>
<one in="W" out="G"/>
</markov>
</sequence>
12 changes: 12 additions & 0 deletions models/BasicDungeonGrowth.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<sequence values="BRACDG" origin="Center">
<union symbol="?" values="BR"/>
<one in="**?**/*BBB*/*BBB?/*BBB*/**R**" out="AARAA/ADDDA/ADDDR/ADDDA/AACAA"/>
<one in="ACA/BBB" out="ARA/BBB"/>
<all>
<rule in="C" out="D"/>
<rule in="R" out="D"/>
</all>
<all in="BD" out="*A"/>
<all in="DDD/ADA/DDD" out="***/D*D/***"/>
<all in="DDD/DAD/DDD" out="***/*D*/***"/>
</sequence>
Loading

0 comments on commit 222cd2e

Please sign in to comment.