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
const syllables = ["ad","al","alm","am","an","ant","arb","as","bak","ban","bar","bel","bes","bil","bin","bon","bor","bril","cer","com","cor","cron","dag","dan","dar","dor","dur","en","end","er","fed","fir","gal","gam","gan","gess","gli","glo","goh","gul","hon","is","jum","kal","kam","kar","kes","kom","kur","lan","les","lid","lor","us","mel","mer","mim","myr","nab","nal","nat","nik","nog","nub","om","on","ond","phin","pin","rax","rer","rif","rin","ris","rish","ron","rur","rut","ryl","sav","sel","sen","sem","sul","sum","tal","tan","tel","tis","top","tro","tros","um","val","var","ver","wat","yin","zel","zoc"]; | |
const suffixes = ["a","aan","ar","as","ea","eer","i","ia","in","ine","ior","ir","is","oo","os","oth","u","uk","yi","yn"]; | |
const nameLength = [1,2,2,3,3,4]; | |
const spacing = [[1,,,],[,1,,],[1,1,,],[,,1,],[1,,1,],[,1,1,],[1,1,1,]]; | |
Math.randomInt = function(max, min = 0) { return Math.floor(Math.random()*(max - min + 1)) + min; }; | |
String.prototype.capitalize = function() { return this.charAt(0).toUpperCase() |
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
{ | |
"gmSettings": { | |
"default": { | |
"items": [ | |
{ | |
"disposition": "FRIENDLY", | |
"items": [ | |
{ | |
"value": "{hp = <attributes.hp.value>;\n hpm = <attributes.hp.max>;\n concat(string(hp), \"/\", string(hpm))\n}", | |
"icon": "fa-heart", |
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
// Credit: https://stackoverflow.com/users/887210/colgraff | |
struct Header { | |
let version : UInt | |
let options : UInt | |
let records : UInt | |
} | |
// adds marshaling | |
extension Header { | |
enum Keys: String { case version, options, records } |
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
import Foundation | |
// Get input from the user | |
func getInput() -> String? { | |
print("\nDice: ", terminator: "") | |
guard let newInput = readLine()?.lowercased() else { return nil } | |
if newInput == "q" { | |
print("Thanks for rolling with me!") | |
exit(EXIT_SUCCESS) |