ಚಿತ್ರ:MAZE 30x20 Prim.ogv
testwikiದಿಂದ
ನ್ಯಾವಿಗೇಷನ್ಗೆ ಹೋಗು
ಹುಡುಕಲು ಹೋಗು
MAZE_30x20_Prim.ogv (ಫೈಲಿನ ಗಾತ್ರ: ೧.೧ MB, MIME ಪ್ರಕಾರ: application/ogg)
ಈ ಕಡತವು Wikimedia Commons ಇಂದ ಬಂದಿದ್ದು, ಬೇರೆ ಯೋಜನೆಗಳಲ್ಲೂ ಉಪಯೋಗಿಸಲ್ಪಡಬಹುದು. [ಕಡತ ವಿವರಣಾ ಪುಟ]ದಲ್ಲಿರುವ ವಿವರಣೆಯನ್ನು ಕೆಳಗೆ ಕೊಡಲಾಗಿದೆ.
|
ಸಾರಾಂಶ
| ವಿವರMAZE 30x20 Prim.ogv |
English: The generation of a maze using a randomized Prim's algorithm. This maze is 30x20 in size. |
| ದಿನಾಂಕ | |
| ಆಕರ | ಸ್ವಂತ ಕೆಲಸ |
| ಕರ್ತೃ | Purpy Pupple |
| ಇತರೆ ಆವೃತ್ತಿಗಳು |
|
Source code
#include <iostream>
#include <queue>
#include <random>
#include <utility>
#include <vector>
#include <cstdio>
using namespace std;
const int xsize = 20;
const int ysize = 30;
int main() {
random_device rd;
mt19937 en(rd());
uniform_real_distribution<double> uni(0,1);
vector<int> v(xsize*ysize, 0);
vector<int> w(xsize*ysize*2, 1);
vector<vector<pair<double, pair<int, int>>>> e(xsize*ysize);
for(int i=0; i<xsize; i++) {
for(int j=0; j<ysize; j++) {
int k = i*ysize + j;
if(i>0) e[k].push_back(make_pair(uni(en), make_pair(k, (i-1)*ysize + j)));
if(j>0) e[k].push_back(make_pair(uni(en), make_pair(k, i*ysize + (j-1))));
if(i<xsize-1) e[k].push_back(make_pair(uni(en), make_pair(k, (i+1)*ysize + j)));
if(j<ysize-1) e[k].push_back(make_pair(uni(en), make_pair(k, i*ysize + (j+1))));
}
}
priority_queue <pair<double, pair<int, int>>> frontier;
int x = 0, y = 0;
v[x*ysize + y] = 1;
for(auto k : e[0]) {
frontier.push(k);
}
while(!frontier.empty()) {
auto z = frontier.top();
frontier.pop();
int a = z.second.first;
int b = z.second.second;
if(v[b]) continue;
v[b] = 2;
int aa = min(a,b);
int bb = max(a,b);
if(bb-aa == 1) {
w[2*aa] = 0;
} else {
w[2*aa+1] = 0;
}
for(auto k : e[b]) {
if(!v[k.second.second]) {
frontier.push(k);
}
}
// print the thing lol
for(int j=0; j<2*ysize+1; j++) {
cout << "1 ";
}
for(int i=0; i<xsize; i++) {
cout << endl << "1 ";
for(int j=0; j<ysize; j++) {
cout << "102"[v[i*ysize + j]] << " " << "01"[w[2*(i*ysize + j)]] << " ";
}
cout << endl << "1 ";
for(int j=0; j<ysize; j++) {
cout << "01"[w[2*(i*ysize + j)+1]] << " 1 ";
}
}
cout << endl;
v[b] = 1;
}
}
ಪರವಾನಗಿ
I, the copyright holder of this work, hereby publish it under the following licenses:
ಈ ಕಡತ ಕ್ರಿಯೇಟಿವ್ ಕಾಮನ್ಸ್ Attribution
-Share Alike 3.0 Unported ಪರವಾನಗಿ ಹೊಂದಿದೆ.
- ನೀವು ಮುಕ್ತ:
- ಹಂಚಿಕೆಗೆ – ಕೆಲಸವನ್ನು ನಕಲು ಮಾಡಲು, ವಿತರಣೆ ಮತ್ತು ಸಾಗಿಸಲು
- ರೀಮಿಕ್ಸ್ ಮಾಡಲು – ಕೆಲಸವನ್ನು ಬಳಸಿಕೊಳ್ಳಲು
- ಈ ಕೆಳಗಿನ ಷರತ್ತುಗಳಲ್ಲಿ:
- ವೈಶಿಷ್ಟ್ಯ – ನೀವು ಸೂಕ್ತವಾದ ಕ್ರೆಡಿಟ್ ನೀಡಬೇಕು, ಪರವಾನಗಿಗೆ ಲಿಂಕ್ ಅನ್ನು ಒದಗಿಸಬೇಕು ಮತ್ತು ಯಾವುದೇ ಬದಲಾವಣೆಗಳನ್ನು ಮಾಡಿದ್ದರೆ ಸೂಚಿಸಬೇಕು. ನೀವು ಯಾವುದೇ ಸಮಂಜಸವಾದ ರೀತಿಯಲ್ಲಿ ಮಾಡಬಹುದು, ಆದರೆ ಪರವಾನಗಿದಾರರು ನಿಮ್ಮನ್ನು ಅಥವಾ ನಿಮ್ಮ ಯಾವುದೇ ಬಳಕೆಯನ್ನು ಅನುಮೋದಿಸಿದಂತೆ ರೀತಿಯಲ್ಲಿ ಉಪಯೋಗಿಸಬಾರದು.
- ಇರುವುದರಂತೆಯೇ ಹಂಚು – ನೀವು ರೀಮಿಕ್ಸ್ ಮಾಡಿದರೆ, ರೂಪಾಂತರಗೊಳಿಸಿದರೆ ಅಥವಾ ವಸ್ತುವಿನ ಮೇಲೆ ನಿರ್ಮಿಸಿದರೆ, ನಿಮ್ಮ ಕೊಡುಗೆಗಳನ್ನು ನೀವು ಮೂಲದಂತೆ ಅದೇ ಅಥವಾ ಹೊಂದಾಣಿಕೆಯ ಪರವಾನಗಿ ಅಡಿಯಲ್ಲಿ ವಿತರಿಸಬೇಕು.
| GNU ಉಚಿತ ಡಾಕ್ಯುಮೆಂಟೇಶನ್ ಪರವಾನಗಿ, ಆವೃತ್ತಿಯ ನಿಯಮಗಳ ಅಡಿಯಲ್ಲಿ ಈ ಡಾಕ್ಯುಮೆಂಟ್ ಅನ್ನು ನಕಲಿಸಲು, ವಿತರಿಸಲು ಮತ್ತು/ಅಥವಾ ಮಾರ್ಪಡಿಸಲು ಅನುಮತಿಯನ್ನು ನೀಡಲಾಗಿದೆ. 1.2 ಅಥವಾ ಯಾವುದೇ ನಂತರದ ಆವೃತ್ತಿಯನ್ನು ಉಚಿತ ಸಾಫ್ಟ್ವೇರ್ ಫೌಂಡೇಶನ್ ಪ್ರಕಟಿಸಿದೆ; ಯಾವುದೇ ಅಸ್ಥಿರ ವಿಭಾಗಗಳಿಲ್ಲದೆ, ಮುಖ ಪಠ್ಯಗಳಿಲ್ಲ ಮತ್ತು ಹಿಂದಿನ ಕವರ್ ಪಠ್ಯಗಳಿಲ್ಲ. ಪರವಾನಗಿಯ ಪ್ರತಿಯನ್ನು GNU ಉಚಿತ ಡಾಕ್ಯುಮೆಂಟೇಶನ್ ಪರವಾನಗಿ ಎಂಬ ವಿಭಾಗದಲ್ಲಿ ಸೇರಿಸಲಾಗಿದೆ.http://www.gnu.org/copyleft/fdl.htmlGFDLGNU Free Documentation Licensetruetrue |
ನಿಮ್ಮಿಚ್ಛೆಯ ಪರವಾನಗಿಯನ್ನು ನೀವು ಆರಿಸಿಕೊಳ್ಳಬಹುದು.
Captions
Add a one-line explanation of what this file represents
The generation of a maze using a randomized Prim's algorithm. This maze is 30x20 in size.
Items portrayed in this file
depicts ಇಂಗ್ಲಿಷ್
some value
copyright status ಇಂಗ್ಲಿಷ್
copyrighted ಇಂಗ್ಲಿಷ್
೫ ಫೆಬ್ರವರಿ 2011
source of file ಇಂಗ್ಲಿಷ್
original creation by uploader ಇಂಗ್ಲಿಷ್
media type ಇಂಗ್ಲಿಷ್
application/ogg
ಕಡತದ ಇತಿಹಾಸ
ದಿನ/ಕಾಲ ಒತ್ತಿದರೆ ಆ ಸಮಯದಲ್ಲಿ ಈ ಕಡತದ ವಸ್ತುಸ್ಥಿತಿ ತೋರುತ್ತದೆ.
| ದಿನ/ಕಾಲ | ಆಯಾಮಗಳು | ಬಳಕೆದಾರ | ಟಿಪ್ಪಣಿ | |
|---|---|---|---|---|
| ಪ್ರಸಕ್ತ | ೨೩:೧೩, ೧೧ ಜೂನ್ ೨೦೧೫ | (೧.೧ MB) | wikimediacommons>Dllu | Fixes a bug that caused it to be not actually Prim's algorithm. |
ಕಡತ ಬಳಕೆ
ಈ ಕೆಳಗಿನ ಪುಟವು ಈ ಚಿತ್ರಕ್ಕೆ ಸಂಪರ್ಕ ಹೊಂದಿದೆ:
"https://kn.wiki.beta.math.wmflabs.org/wiki/ಚಿತ್ರ:MAZE_30x20_Prim.ogv" ಇಂದ ಪಡೆಯಲ್ಪಟ್ಟಿದೆ