Last active
November 8, 2019 14:11
-
-
Save GoSubRoutine/9aa9cd00000e331612c8e557b5dd28f0 to your computer and use it in GitHub Desktop.
JSON Religions
This file contains 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
height: 325 |
This file contains 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
{ | |
"religion": [{ | |
"Arceusism": "Worshippers of Arceus, the creator of all Pokémon. See also Giratinism.", | |
"The Babarambaba Cult": "Worshippers of Mother Nature, personified in a head of lettuce named Ralph.", | |
"Bajoran religion": "Star Trek: Deep Space Nine.", | |
"Bandosianism": "RuneScape's war religion.", | |
"Banjoism": "Elan's religion in The Order of the Stick.", | |
"Beism": "Giles Goat-Boy, John Barth.", | |
"Beliar": "Gothic (video game), god of darkness, death and chaos and lord of lightning and earth.", | |
"Bene Gesserit": "Dune series." | |
}] | |
} |
This file contains 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
<!DOCTYPE html> | |
<meta charset=UTF-8> | |
<script async src=https://cdn.JsDelivr.net/npm/p5></script> | |
<script defer src=sketch.js></script> |
This file contains 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
/** | |
* JSON Religions (v1.0) | |
* GoToLoop (2017-May-05) | |
* | |
* https://Forum.Processing.org/two/discussion/22401/ | |
* how-do-i-display-this-data-as-text#Item_4 | |
* | |
* http://Bl.ocks.org/GoSubRoutine/9aa9cd00000e331612c8e557b5dd28f0 | |
*/ | |
"use strict"; | |
const FILENAME = 'flower.json'; | |
let religions; | |
function preload() { | |
loadJSON(FILENAME, ({religion: [obj]}) => religions = obj); | |
} | |
function setup() { | |
noCanvas(), noLoop(); | |
console.table(religions); | |
for (const key in religions) { | |
const religion = `<u>${key}</u>: `.bold().big(), | |
description = religions[key].italics(); | |
createP(religion + description); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment