ࡱ> Root Entryp|YrRASHF,Contents=CPage 1+"4-./012356789:;<>?@ABCDEFGHIJKLMNOPQTUXY[\]^_`abcRoot Entryp|YrRASH*,ContentsCPage 16  !"#$%&'()*R-./0123SVWZdeCPicPage CPicLayer CPicFrame?J // maze width dim_x = 48; // maze height dim_y = 28; // wall lenght wall_size = 10; cell_count = dim_x*dim_y; var maze = new Array(); var mymoves = new Array(); for (x=0; x<cell_count; x++) { maze[x] = new Array(0, 1, 1, 1); // array contains VISITED (0 = not visited), MORTH WALL (1=up;0=down), SOUTH WALL, EAST WALL, WEST WALL } // start position pos = Math.round(Math.random()*(cell_count-1)); // cells visited visited = 1; // mark first cell as visited maze[pos][0] = 1; while (visited<cell_count) { // check for possible moves possible = ""; if ((Math.floor(pos/dim_x) == Math.floor((pos-1)/dim_x)) and (maze[pos-1][0] == 0)) { possible = possible+"W"; } if ((Math.floor(pos/dim_x) == Math.floor((pos+1)/dim_x)) and (maze[pos+1][0] == 0)) { possible = possible+"E"; } if (((pos+dim_x)<cell_count) and (maze[pos+dim_x][0] == 0)) { possible = possible+"S"; } if (((pos-dim_x)>=0) and (maze[pos-dim_x][0] == 0)) { possible = possible+"N"; } // if a move exists, crash a wall and mark new cell as visited if (possible) { visited++; mymoves.push(pos); way = possible.charAt(Math.round(Math.random()*(possible.length-1))); switch (way) { case "N" : maze[pos][1] = 0; maze[pos-dim_x][2] = 0; pos -= dim_x; break; case "S" : maze[pos][2] = 0; maze[pos+dim_x][1] = 0; pos += dim_x; break; case "E" : maze[pos][3] = 0; maze[pos+1][4] = 0; pos++; break; case "W" : maze[pos][4] = 0; maze[pos-1][3] = 0; pos--; break; } maze[pos][0] = 1; // else backtrack to previous visited cell } else { pos = mymoves.pop(); } } // maze drawing this.createEmptyMovieClip("drawmaze", 10); drawmaze.lineStyle(0, 0x000000, 100); drawmaze.moveTo(10, 10); start_y = 10-wall_size; start_x = 0; for (x=0; x<cell_count; x++) { start_x += wall_size; if ((x%dim_x) == 0) { start_y += wall_size; start_x = 10; } if (maze[x][2] == 1) { // south drawmaze.moveTo(start_x, start_y+wall_size); drawmaze.lineTo(start_x+wall_size, start_y+wall_size); //drawmaze.moveTo(start_x, start_y); } if (maze[x][3] == 1) { // east drawmaze.moveTo(start_x+wall_size, start_y); drawmaze.lineTo(start_x+wall_size, start_y+wall_size); //drawmaze.moveTo(start_x, start_y); } } drawmaze.lineStyle(0, 0xff0000, 100); drawmaze.moveTo(10, 10); drawmaze.lineTo(10+wall_size*dim_x, 10); drawmaze.lineTo(10+wall_size*dim_x, 10+wall_size*dim_y); drawmaze.lineTo(10, 10+wall_size*dim_y); drawmaze.lineTo(10, 10);  Layer 1OOishFormatProperties::htmlFileName Untitled-1 PublishQTProperties::LayerOption PublishQTPropertie? CDocumentPagePage 1Scene 1JDgiD'phhhhhlegacyLineSpacing0%PublishFormatProperties::htmlFileName Untitled-1"PublishHtmlProperties::StartPaused0Vector::AS3 Package Paths PublishRNWKProperties::speed256K0!PublishGifProperties::PaletteNamePublishFormatProperties::jpeg0PublishHtmlProperties::Loop1PublishProfileProperties::nameDefaultVector::Debugging Permitted0Vector::UseNetwork0"PublishQTProperties::MatchMovieDim1 PublishQTProperties::AlphaOption PublishQTProperties::LayerOption4PublishHtmlProperties::UsingDefaultAlternateFilename1PublishHtmlProperties::Units0%PublishHtmlProperties::showTagWarnMsg1Vector::External Player&PublishRNWKProperties::singleRateAudio0&PublishRNWKProperties::speedSingleISDN0$PublishPNGProperties::OptimizeColors1PublishQTProperties::Width550%PublishFormatProperties::projectorMac0'PublishFormatProperties::gifDefaultName1&PublishFormatProperties::flashFileNameUntitled-1.swfVector::Package PathsVector::Compress Movie1#PublishRNWKProperties::flashBitRate1200%PublishRNWKProperties::mediaCopyright(c) 2000PublishGifProperties::Smooth1PublishFormatProperties::html1$PublishFormatProperties::pngFileNameUntitled-1.png(PublishHtmlProperties::VerticalAlignment1PublishHtmlProperties::Quality4Vector::FireFox0"PublishRNWKProperties::exportAudio1 PublishRNWKProperties::speed384K0!PublishRNWKProperties::exportSMIL1"PublishGifProperties::DitherOption-PublishFormatProperties::generatorDefaultName1!PublishHtmlProperties::DeviceFont0Vector::Override Sounds0'PublishRNWKProperties::mediaDescription"PublishPNGProperties::FilterOptionPublishFormatProperties::gif0(PublishFormatProperties::jpegDefaultName1(PublishFormatProperties::rnwkDefaultName1*PublishFormatProperties::generatorFileNameUntitled-1.swtVector::Template02PublishHtmlProperties::VersionDetectionIfAvailable0*PublishHtmlProperties::HorizontalAlignment1"PublishHtmlProperties::DisplayMenu1Vector::Protect0Vector::Quality80PublishJpegProperties::DPI4718592PublishGifProperties::Interlace0"PublishGifProperties::DitherSolids0PublishPNGProperties::Smooth1PublishPNGProperties::BitDepth24-bit with AlphaPublishQTProperties::Flatten1#PublishFormatProperties::qtFileNameUntitled-1.movPublishRNWKProperties::speed28K1!PublishRNWKProperties::mediaTitle$PublishRNWKProperties::mediaKeywordsPublishGifProperties::Width550PublishGifProperties::Loop1PublishFormatProperties::flash1PublishJpegProperties::Quality80$PublishRNWKProperties::realVideoRate100000$PublishRNWKProperties::speedDualISDN0#PublishGifProperties::MatchMovieDim1#PublishGifProperties::PaletteOption"PublishPNGProperties::DitherOption0PublishFormatProperties::projectorMacDefaultName1'PublishFormatProperties::pngDefaultName1-PublishFormatProperties::projectorWinFileNameUntitled-1.exePublishHtmlProperties::Align0!PublishProfileProperties::version1Vector::Package Export Frame1$PublishJpegProperties::MatchMovieDim1#PublishPNGProperties::MatchMovieDim1#PublishPNGProperties::PaletteOption)PublishFormatProperties::flashDefaultName1%PublishFormatProperties::jpegFileNameUntitled-1.jpgPublishHtmlProperties::Width550PublishHtmlProperties::Height400Vector::Omit Trace Actions0Vector::Debugging Password"PublishJpegProperties::Progressive0"PublishPNGProperties::DitherSolids0#PublishQTProperties::PlayEveryFrame0PublishFormatProperties::png0PublishFormatProperties::rnwk0(PublishFormatProperties::htmlDefaultName1-PublishFormatProperties::projectorMacFileNameUntitled-1.hqx2PublishHtmlProperties::UsingDefaultContentFilename1!PublishHtmlProperties::WindowMode0'PublishHtmlProperties::TemplateFileName Default.htmlVector::TopDown0Vector::DeviceSound0PublishJpegProperties::Size0PublishGifProperties::Height400PublishPNGProperties::Interlace0"PublishFormatProperties::generator0&PublishHtmlProperties::ContentFilename(PublishHtmlProperties::AlternateFilename+PublishHtmlProperties::OwnAlternateFilenameVector::Report0PublishRNWKProperties::speed56K1PublishGifProperties::LoopCount'PublishGifProperties::TransparentOptionPublishGifProperties::MaxColors255%PublishPNGProperties::RemoveGradients0PublishQTProperties::Height400PublishFormatProperties::qt0Vector::Stream Compress7Vector::Event Format0Vector::Version8"PublishRNWKProperties::audioFormat0$PublishGifProperties::OptimizeColors10PublishFormatProperties::projectorWinDefaultName1PublishHtmlProperties::Scale0Vector::Event Compress7Vector::ActionScriptVersion2Vector::StreamUse8kSampleRate0Vector::EventUse8kSampleRate0PublishJpegProperties::Height400 PublishRNWKProperties::speed512K0%PublishGifProperties::RemoveGradients0PublishPNGProperties::Width550PublishPNGProperties::Height400&PublishFormatProperties::qtDefaultName1$PublishFormatProperties::gifFileNameUntitled-1.gif"PublishHtmlProperties::VersionInfo@8,0,0,0;7,0,0,0;6,0,0,0;5,0,0,0;4,0,0,0;3,0,0,0;2,0,0,0;1,0,0,0;Vector::Stream Format0PublishJpegProperties::Width550"PublishRNWKProperties::exportFlash1&PublishRNWKProperties::showBitrateDlog1(PublishRNWKProperties::speedCorporateLAN0"PublishRNWKProperties::mediaAuthorPublishGifProperties::Animated0&PublishGifProperties::TransparentAlpha128!PublishPNGProperties::Transparent0!PublishPNGProperties::PaletteName*PublishQTProperties::UseQTSoundCompression0PublishQTProperties::Looping0%PublishFormatProperties::defaultNames1%PublishFormatProperties::projectorWin0%PublishFormatProperties::rnwkFileNameUntitled-1.smil,PublishHtmlProperties::UsingOwnAlternateFile0PublishPNGProperties::MaxColors255%PublishQTProperties::ControllerOption0"PublishQTProperties::PausedAtStart0 CColorDef3PfP0PHP`Px333(3f<03CH3F`3Hxf0f30ff(0f5Hf<`f@x3330333xf3d03]H3Z`3Xx3333303f3PPH33Px`33Px33Pf30f33PHff3(PHf3<x`f3Cxf3Ffff`f03f0ffx0fkHfd`f`x3f033fPH3ffxPH3fdx`3f]x3fZff0f3fPHfff`ffP0xffPxffPH3HfHxH̙n`hx3H33x`3fx`3xx`3̙kx3dfHf3x`ff0xfx0xf̙dxf]`3`f``x`pxCPicPage CPicLayer CPicFrame?Jdim_x = 5; dim_y = 5; wall_size = 15; cell_count = dim_x*dim_y; var maze = new Array(); var mymoves = new Array(); for (x=0; x<cell_count; x++) { maze[x] = new Array(0, 1CPicPage CPicLayer CPicFrame?gdim_x = 5; dim_y = 5; cell_count = dim_x*dim_y; var maze = new Array(); var mymoves = new Array(); for (x=0; x<cell_count; x++) { maze[x] = new Array(0, 1, 1, 1); } pos = Math.round(Math.random()*(cell_count-1)); visited = 1; maze[pos][0] = 1; while (visited<cell_count) { possible = ""; if ((Math.floor(pos/dim_x) == Math.floor((pos-1)/dim_x)) and (maze[pos-1][0] == 0)) { possible = possible+"W"; } if ((Math.floor(pos/dim_x) == Math.floor((pos+1)/dim_x)) and (maze[pos+1][0] == 0)) { possible = possible+"E"; } if (((pos+dim_x)<cell_count) and (maze[pos+dim_x][0] == 0)) { possible = possible+"S"; } if (((pos-dim_x)>=0) and (maze[pos-dim_x][0] == 0)) { possible = possible+"N"; } if (possible) { visited++; mymoves.push(pos); way = possible.charAt(Math.round(Math.random()*(possible.length-1))); switch (way) { case "N" : maze[pos][1] = 0; maze[pos-dim_x][2] = 0; pos -= dim_x; break; case "S" : maze[pos][2] = 0; maze[pos+dim_x][1] = 0; pos += dim_x; break; case "E" : maze[pos][3] = 0; maze[pos+1][4] = 0; pos++; break; case "W" : maze[pos][4] = 0; maze[pos-1][3] = 0; pos--; break; } maze[pos][0] = 1; } else { pos = mymoves.pop(); } } this.createEmptyMovieClip("drawmaze", 10); drawmaze.lineStyle(0, 0x000000, 100); drawmaze.moveTo(10, 10); start_y = 10; start_x = 10; for (x=0; x<cell_count; x++) { start_x += x*10; if ((x%dim_x) == 0) { start_y += 10; drawmaze.moveTo(10, start_y); start_x = 10; } if (maze[x][2] == 1) { drawmaze.moveTo(start_x, start_y+10); drawmaze.lineTo(start_x+10, start_y+10); drawmaze.moveTo(start_x, start_y); } }  Layer 1OO { possible = ""; if ((Math.floor(pos/dim_x) == Math.floor((pos-1)/dim_x)) and (maze[pos-1][0] == 0)) { possible = possible + "W"; } if ((Math.floor(pos/dim_x) == Math., 1, 1); } pos = Math.round(Math.random()*(cell_count-1)); visited = 1; maze[pos][0] = 1; while (visited<cell_count) { possible = ""; if ((Math.floor(pos/dim_x) == Math.floor((pos-1)/dim_x)) and (maze[pos-1][0] == 0)) { possible = possible+"W"; } if ((Math.floor(pos/dim_x) == Math.floor((pos+1)/dim_x)) and (maze[pos+1][0] == 0)) { possible = possible+"E"; } if (((pos+dim_x)<cell_count) and (maze[pos+dim_x][0] == 0)) { possible = possible+"S"; } if (((pos-dim_x)>=0) and (maze[pos-dim_x][0] == 0)) { possible = possible+"N"; } if (possible) { visited++; mymoves.push(pos); way = possible.charAt(Math.round(Math.random()*(possible.length-1))); switch (way) { case "N" : maze[pos][1] = 0; maze[pos-dim_x][2] = 0; pos -= dim_x; break; case "S" : maze[pos][2] = 0; maze[pos+dim_x][1] = 0; pos += dim_x; break; case "E" : maze[pos][3] = 0; maze[pos+1][4] = 0; pos++; break; case "W" : maze[pos][4] = 0; maze[pos-1][3] = 0; pos--; break; } maze[pos][0] = 1; } else { pos = mymoves.pop(); } } this.createEmptyMovieClip("drawmaze", 10); drawmaze.lineStyle(0, 0x000000, 100); drawmaze.moveTo(10, 10); start_y = 10-wall_size; start_x = 0; for (x=0; x<cell_count; x++) { start_x += wall_size; if ((x%dim_x) == 0) { start_y += wall_size; start_x = 10; } if (maze[x][2] == 1) { // south drawmaze.moveTo(start_x, start_y+wall_size); drawmaze.lineTo(start_x+wall_size, start_y+wall_size); //drawmaze.moveTo(start_x, start_y); } if (maze[x][3] == 1) { // east drawmaze.moveTo(start_x+wall_size, start_y); drawmaze.lineTo(start_x+wall_size, start_y+wall_size); //drawmaze.moveTo(start_x, start_y); } } drawmaze.lineStyle(0, 0xff0000, 100); drawmaze.moveTo(10,10); drawmaze.lineTo(10+wall_size*dim_x,10); drawmaze.lineTo(10+wall_size*dim_x,10+wall_size*dim_y); drawmaze.lineTo(10,10+wall_size*dim_y); drawmaze.lineTo(10,10);  Layer 1OOlishGifProperties::Interlace0PublishJpegProperties::DPI4718592Vector::Quality80Vector::Protect0"PublishHtmlProperties::DisplayMenu1*PublishHtmlProperties::HorizontalAlignment12PublishHtmlProperties::VersionDetectionIfA? CDocumentPagePage 1Scene 1JDgD*@hhhhh legacyLineSpacing0%PublishFormatProperties::htmlFileName Untitled-1"PublishHtmlProperties::StartPaused0Vector::AS3 Package Paths PublishRNWKProperties::speed256K0!PublishGifProperties::PaletteNamePublishFormatProperties::jpeg0PublishHtmlProperties::Loop1PublishProfileProperties::nameDefaultVector::Debugging Permitted0Vector::UseNetwork0"PublishQTProperties::MatchMovieDim1 PublishQTProperties::AlphaOption PublishQTProperties::LayerOption4PublishHtmlProperties::UsingDefaultAlternateFilename1PublishHtmlProperties::Units0%PublishHtmlProperties::showTagWarnMsg1Vector::External Player&PublishRNWKProperties::singleRateAudio0&PublishRNWKProperties::speedSingleISDN0$PublishPNGProperties::OptimizeColors1PublishQTProperties::Width550%PublishFormatProperties::projectorMac0'PublishFormatProperties::gifDefaultName1&PublishFormatProperties::flashFileNameUntitled-1.swfVector::Package PathsVector::Compress Movie1#PublishRNWKProperties::flashBitRate1200%PublishRNWKProperties::mediaCopyright(c) 2000PublishGifProperties::Smooth1PublishFormatProperties::html1$PublishFormatProperties::pngFileNameUntitled-1.png(PublishHtmlProperties::VerticalAlignment1PublishHtmlProperties::Quality4Vector::FireFox0"PublishRNWKProperties::exportAudio1 PublishRNWKProperties::speed384K0!PublishRNWKProperties::exportSMIL1"PublishGifProperties::DitherOption-PublishFormatProperties::generatorDefaultName1!PublishHtmlProperties::DeviceFont0Vector::Override Sounds0'PublishRNWKProperties::mediaDescription"PublishPNGProperties::FilterOptionPublishFormatProperties::gif0(PublishFormatProperties::jpegDefaultName1(PublishFormatProperties::rnwkDefaultName1*PublishFormatProperties::generatorFileNameUntitled-1.swtVector::Template02PublishHtmlProperties::VersionDetectionIfAvailable0*PublishHtmlProperties::HorizontalAlignment1"PublishHtmlProperties::DisplayMenu1Vector::Protect0Vector::Quality80PublishJpegProperties::DPI4718592PublishGifProperties::Interlace0"PublishGifProperties::DitherSolids0PublishPNGProperties::Smooth1PublishPNGProperties::BitDepth24-bit with AlphaPublishQTProperties::Flatten1#PublishFormatProperties::qtFileNameUntitled-1.movPublishRNWKProperties::speed28K1!PublishRNWKProperties::mediaTitle$PublishRNWKProperties::mediaKeywordsPublishGifProperties::Width550PublishGifProperties::Loop1PublishFormatProperties::flash1PublishJpegProperties::Quality80$PublishRNWKProperties::realVideoRate100000$PublishRNWKProperties::speedDualISDN0#PublishGifProperties::MatchMovieDim1#PublishGifProperties::PaletteOption"PublishPNGProperties::DitherOption0PublishFormatProperties::projectorMacDefaultName1'PublishFormatProperties::pngDefaultName1-PublishFormatProperties::projectorWinFileNameUntitled-1.exePublishHtmlProperties::Align0!PublishProfileProperties::version1Vector::Package Export Frame1$PublishJpegProperties::MatchMovieDim1#PublishPNGProperties::MatchMovieDim1#PublishPNGProperties::PaletteOption)PublishFormatProperties::flashDefaultName1%PublishFormatProperties::jpegFileNameUntitled-1.jpgPublishHtmlProperties::Width550PublishHtmlProperties::Height400Vector::Omit Trace Actions0Vector::Debugging Password"PublishJpegProperties::Progressive0"PublishPNGProperties::DitherSolids0#PublishQTProperties::PlayEveryFrame0PublishFormatProperties::png0PublishFormatProperties::rnwk0(PublishFormatProperties::htmlDefaultName1-PublishFormatProperties::projectorMacFileNameUntitled-1.hqx2PublishHtmlProperties::UsingDefaultContentFilename1!PublishHtmlProperties::WindowMode0'PublishHtmlProperties::TemplateFileName Default.htmlVector::TopDown0Vector::DeviceSound0PublishJpegProperties::Size0PublishGifProperties::Height400PublishPNGProperties::Interlace0"PublishFormatProperties::generator0&PublishHtmlProperties::ContentFilename(PublishHtmlProperties::AlternateFilename+PublishHtmlProperties::OwnAlternateFilenameVector::Report0PublishRNWKProperties::speed56K1PublishGifProperties::LoopCount'PublishGifProperties::TransparentOptionPublishGifProperties::MaxColors255%PublishPNGProperties::RemoveGradients0PublishQTProperties::Height400PublishFormatProperties::qt0Vector::Stream Compress7Vector::Event Format0Vector::Version8"PublishRNWKProperties::audioFormat0$PublishGifProperties::OptimizeColors10PublishFormatProperties::projectorWinDefaultName1PublishHtmlProperties::Scale0Vector::Event Compress7Vector::ActionScriptVersion2Vector::StreamUse8kSampleRate0Vector::EventUse8kSampleRate0PublishJpegProperties::Height400 PublishRNWKProperties::speed512K0%PublishGifProperties::RemoveGradients0PublishPNGProperties::Width550PublishPNGProperties::Height400&PublishFormatProperties::qtDefaultName1$PublishFormatProperties::gifFileNameUntitled-1.gif"PublishHtmlProperties::VersionInfo@8,0,0,0;7,03`33x3fx3x3xx3nf`f3xffxfxfxxfkx3xfxxxxx3x333f333xfxf3fffffxxH3 HfH(H2`8x`3 `f`̙`(`0xx3xfxx x(xPx3H33x`f3x`3(x`35x3<3`33xf3 x̙3x3(x,0,0;6,0,0,0;5,0,0,0;4,0,0,0;3,0,0,0;2,0,0,0;1,0,0,0;Vector::Stream Format0PublishJpegProperties::Width550"PublishRNWKProperties::exportFlash1&PublishRNWKProperties::showBitrateDlog1(PublishRNWKProperties::speedCorporateLAN0"PublishRNWKProperties::mediaAuthorPublishGifProperties::Animated0&PublishGifProperties::TransparentAlpha128!PublishPNGProperties::Transparent0!PublishPNGProperties::PaletteName*PublishQTProperties::UseQTSoundCompression0PublishQTProperties::Looping323x33f3 333(xfH3fx`ff0xf(0xf<xfCf`3fxffx̙fxf(xf5fx3ffff ff((xH3x`f0x̙PPP`3xfx̙P̙(P<x3f̙(xx`3xfxPxPd`3xfx̙PPx3f0%PublishFormatProperties::defaultNames1%PublishFormatProperties::projectorWin0%PublishFormatProperties::rnwkFileNameUntitled-1.smil,PublishHtmlProperties::UsingOwnAlternateFile0PublishPNGProperties::MaxColors255%PublishQTProperties::ControllerOption0"PublishQTProperties::PausedAtStart0 CColorDef3PfP0PHP`Px333(3f<03CH3F`3Hxf0f30ff(0f5Hf<`f@x33303(xx3fxx3f̙xx3f33xf3d03]H3Z`3Xx3333303f3PPH33Px`33Px33Pf30f33PHff3(PHf3<x`f3Cxf3Ffff`f03f0ffx0fkHfd`f`x3f033fPH3ffxPH3fdx`3f]x3fZff0f3fPHfff`ffP0xffPxffPH3HfHxH̙n`hx3H33x`3fx`3xx`3̙kx3dfHf3x`ff0xfx0xf̙dxf]`3`f``x`px3`33x3fx3x3xx3nf`f3xffxfxfxxfkx3xfxxxxx3x333f333xfxf3fffffxxH3 HfH(H2`8x`3 `f`̙`(`0xx3xfxx x(xPx3H33x`f3x`3(x`35x3<3`33xf3 x̙3x3(x323x33f3 333(xfH3fx`ff0xf(0xf<xfCf`3fxffx̙fxf(xf5fx3ffff ff((xH3x`f0x̙PPP`3xfx̙P̙(P<x3f̙(xx`3xfxPxPd`3xfx̙PPx3f(xx3fxx3f̙xx3ff`zf*]G"PublishQTProperties::QTSndSettingsCQTAudioSettingsh<?xml version="1.0" encoding="UTF-16" standalone="no" ?> <mobileSettings> <contentType id="standalonePlayer" name="Standalone Player"/> <testDevices/> </mobileSettings> f`zf*]G"PublishQTProperties::QTSndSettingsCQTAudioSettingsh<?xml version="1.0" encoding="UTF-16" standalone="no" ?> <mobileSettings> <contentType id="standalonePlayer" name="Standalone Player"/> <testDevices/> </mobileSettings>