[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Make a Labyrinth Generator! in any language, go!

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 63
Thread images: 12

File: images.png (2KB, 225x225px) Image search: [Google]
images.png
2KB, 225x225px
Make a Labyrinth Generator!
in any language, go!
>>
File: bowie.jpg (433KB, 1242x1920px) Image search: [Google]
bowie.jpg
433KB, 1242x1920px
>>58906606
>>
Is there some sort of algorithm?
>>
>labyrinth
>single straight path

You are literally retarded. Kill yourself.
>>
>>58906606
this sounds like homework.

Are you looking for walls like pic related or rooms and connecting hallways?
>>
>>58908057
a labyrinth isnt a maze you stupid moron
>>
>>58910277
> Daedalus had so cunningly made the Labyrinth that he could barely escape it after he built it.
> Thinking it is a straight path
>>
File: Unsorted 1485.jpg (324KB, 802x800px) Image search: [Google]
Unsorted 1485.jpg
324KB, 802x800px
>>58910338
>A labyrinth is unicursal i.e. has only a single, non-branching path, which leads to the center then back out the same way, with only one entry/exit point.

btfo
>>
...or this bird is gonna stab you?
>>
>>58910356
> Til Daedalus was dumber than a literal rock
That's the design of the symbol
>>
File: Unsorted 1510.jpg (1MB, 1600x1200px) Image search: [Google]
Unsorted 1510.jpg
1MB, 1600x1200px
>>58910390
or maybe it was a really complicated labyrinth with weird lighting and mirrors and stuff so you get turned around and lost you giant pseud

<--- me
>>
File: 1485478602795.png (8KB, 602x579px) Image search: [Google]
1485478602795.png
8KB, 602x579px
>>58906606
GNU bash

yes 'printf \\u$[2571+RANDOM%2]' | bash
>>
This is a problem that I attempted to do however it appears to be a different beast compared to a maze since a maze can be represented a a tree and hence can be done using recursive methods such as DFS and Backtracking but a labyrinth has no branching so i'm like wtf
>>
>>58910470
Neat trick.
>>
>>58910277
Yes, it is.
>>
>>58910470
>\\u$[2571+RANDOM%2]
mind to explain this part?
>>
>>58910877
not >>58910470
but
http://www.fileformat.info/info/unicode/char/2571/index.htm
>>
>>58910877
\u says "print some unicode here", 2571 is ╱ and 2472 ╲, +RANDOM%2 will pick on of them randomly
>>
>>58910877
\\u is the escape sequence for unicode chars.
U+2571 is "BOX DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT"
U+2572 is "BOX DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT"
The RANDOM%2 part pics a random number smaller than 2 (i.e. 0 or 1) which would make the resulting character either U+2571 or U+2572.
>>
File: Unsorted 1480.png (278KB, 489x750px) Image search: [Google]
Unsorted 1480.png
278KB, 489x750px
>>58910862
your and idiot
>>
>>58911042
noun
labirint
labyrinth
Definitions of labyrinth
noun
a complicated irregular network of passages or paths in which it is difficult to find one's way; a maze.
"a labyrinth of passages and secret chambers"
synonyms: maze, warren, network
>>
>>58911056
that's not the mathematic definition brainlet
>>
>>58910401
>>58910356
>>58911042
> Weebs are invitation spergs
Who could have guessed?
>>
>>58910470
Pretty.
>>
>>58910470
I don't suppose you knew of this book?
http://10print.org/
>>
File: maze.png (20KB, 1101x1101px) Image search: [Google]
maze.png
20KB, 1101x1101px
http://pastebin.com/LcsrjExG
>>
File: Unsorted 1502.jpg (158KB, 640x800px) Image search: [Google]
Unsorted 1502.jpg
158KB, 640x800px
>>58911968
not a labyrinth
you're disqualified

see:
>>58910356
>>
>>58912000
See
>>58911056
>>
File: Unsorted 1466.jpg (112KB, 877x1240px) Image search: [Google]
Unsorted 1466.jpg
112KB, 877x1240px
>>58912018
that's not the mathematical definition
you're disqualified
>>
>>58911968
Who's got the one that makes your CPU stall when using the paint bucket in MS paint?
>>
>>58912028
>mathematical definition
Only you give a shit
>>
>>58912064
this is a computer SCIENCE thread you pseudo-intellectual go back to r eddit now

you're disqualified from further posting
>>
>>58912084
>he doesn't even know what a labyrinth is
It's explained here >>58911056
>>
>>58912116
it's almost like the entire field of mazeological topology doesnt bend to your every whim pajeet
the real definition is here:
>>58910356
>>
>>58912125
You didn't define in the OP what the thread is exactly about, and yet you call yourself a mathematician. Your further arguments are irrelevant.
>>
>>58910470
how do i write u2571 in Win console? When i write
Console.WriteLine("\\u2571");


i receive ? in Console
>>
>>58912298
>windows
here's your problem
>>
>>58912351
Fuck you Stallman
>>
>>58910470
Finally met one hacker here. Impressive.
>>
#include <iostream>
#include <math.h>

using namespace std;

int main(){
int OP = 0, faggot = 0;

if( OP == faggot ){
cout << "Do your fucking homework you lazy prick!" << endl;
}
else{
cout << "there's nothing else you freaking moron." << endl;
}

cout << "Disgard that i suck cocks" << endl;
return 0;
}
>>
>>58912443
It really is a nice trick
>>
>>58912298
You can't. Windows supports only the basic ASCII.
>>
File: Capture.jpg (41KB, 379x471px) Image search: [Google]
Capture.jpg
41KB, 379x471px
>>58912465
I think cmd supports unicode also with different fonts but when i change it in properties, the change isn't reflecting in Visual Studio
>>
>>58906747
Kinda. Like you can just make a start and end point in a all wall thing and have it search for end and mark along path. Then make it randomly take paths that dont create loops.

So like DFS is the algo basically. Specifically not BFS cuz it will make a route thats super obvious
>>
here is my first game : https://github.com/pexeen/myfirstgame
>>
>>58912490
post screenshot
>>
File: Picturesscreen.png (36KB, 1920x1080px) Image search: [Google]
Picturesscreen.png
36KB, 1920x1080px
>>58912573
>>
>>58912573
It changes every 0.2 s
>>
>hey guys do my homework for me
>>
>>58912687
Literally /g/
>>
>>58912490
This is also pretty cool.
>>
>>58911042
cute!
>>
File: lau5b.webm (491KB, 512x512px) Image search: [Google]
lau5b.webm
491KB, 512x512px
I tried a thing.
>>
>>58914055
This shit is interesting.
Will come back to this thread later. People actually hacking out some interesting maths. Please post interesting code fragments, maths and sources of ideas.
Challenge ^ 3 : 3D labyrinth
Challenge ^ N : Nth dimensional labyrinth generation
>>
>>58912462
>using namespace std;

oh wow
>>
>>58914055
Doom level generator
>>
>>58914175
The only reason not to is if you're learning or naming completely different functions cout
Note: if you do the latter you deserve death
>>
>>58914055
I like how this looks but I can't slow it down, are you taking a straight line and then generating right angles?
>>
>>58914055
That is very cool! Can you post some of the code?
>>
>>58914336
>>58914496

A labyrinth is essentially a string containing the characters 'r', 'l', 'd', and 'u' representing moving one pixel right, left, down or up respectively.
The initial line is something like "rrrrrrrrrrrrrrrrrr". Each step it randomly inserts either an equal amount of 'u's and 'd's, or an equal amount of 'l's and 'r's in this string and checks if the resulting labyrinth is still valid (doesn't bump into itself). For example a second string could be "rrrruuuurrrrrddddrrrrrrrrr".

Code (requires love2d to run):
http://pastebin.com/UkKacDh1
>>
>>58914730
That's really cool. Here's my C# implementation

http://pastebin.com/ERW9dNJf
>>
>>58910338
Daedalu's Labyrinth was a maze, the same way Pandora's Box was actually a jar
>>
>>58915981
> One of the most famous Greek authors misused a Greek word
Thread posts: 63
Thread images: 12


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.