This code creates a Voronoi Diagram of a low-resolution space, generating an approximation of regional divisions of an overworld map typical of the first Legend of Zelda or Link's Awakening. The white squares are randomly generated "centers".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| unmap J | |
| map J nextTab | |
| unmap K | |
| map K previousTab | |
| unmap d | |
| map d removeTab | |
| unmap x | |
| unmap X | |
| unmap u | |
| map u restoreTab |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Inspired by Lee Byron's test data generator. */ | |
| function stream_layers(n, m, o) { | |
| if (arguments.length < 3) o = 0; | |
| function bump(a) { | |
| var x = 1 / (.1 + Math.random()), | |
| y = 2 * Math.random() - .5, | |
| z = 10 / (.1 + Math.random()); | |
| for (var i = 0; i < m; i++) { | |
| var w = (i / m - y) * z; | |
| a[i] += x * Math.exp(-w * w); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from selenium import webdriver | |
| from selenium.common.exceptions import NoSuchElementException | |
| from selenium.webdriver.common.keys import Keys | |
| import time | |
| driver = webdriver.Firefox() | |
| driver.get("http://dampfkraft.com/emdash.html") | |
| print driver.find_element_by_tag_name("p").get_attribute("innerHTML") |
NewerOlder