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
#[ Written by Tommy Ettinger in 2017, based on work by Melissa O'Neill in 2015: | |
PCG-Random, http://www.pcg-random.org/ | |
To the extent possible under law, the author has dedicated all copyright | |
and related and neighboring rights to this software to the public domain | |
worldwide. This software is distributed without any warranty. | |
See <http://creativecommons.org/publicdomain/zero/1.0/>. ]# | |
var x*: uint64 # The state can be seeded with any value. |
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
package com.carterza.planet.map.generator.pathfind; | |
import com.badlogic.gdx.ai.pfa.Connection; | |
import com.badlogic.gdx.ai.pfa.Heuristic; | |
/** | |
* Created by zachcarter on 12/20/16. | |
*/ | |
public class TiledElevationDistance<N extends TiledTerrainNode> implements Heuristic<N> { |
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
private Coord findLowerElevation(Coord currentLocation, GreasedRegion riverBlockages, | |
GreasedRegion heights, GreasedRegion reuse, GreasedRegion temp) { | |
heights.refill(heightData.data, Sand, heightData.data[currentLocation.x][currentLocation.y]) | |
.andNot(riverBlockages); | |
reuse.clear().insert(currentLocation); | |
temp.remake(reuse).fringe(); | |
int searchDistance = 40; | |
for(int d = 1; d < searchDistance; d++) | |
{ |
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
private void generateFactionMap(final int factionCount, double controlledFraction) { | |
MultiSpill spreader = new MultiSpill(new short[WIDTH][HEIGHT], Spill.Measurement.MANHATTAN, CommonRNG.getRng()); | |
OrderedMap<Coord, Double> entries = new OrderedMap<>(); | |
char[][] map = new char[WIDTH][HEIGHT]; | |
short[][] regionMap = new short[WIDTH][HEIGHT]; | |
for(int x = 0; x < WIDTH; x++) { | |
for(int y = 0; y < HEIGHT; y++) { | |
if(tiles[x][y].heightValue >= Sand) |
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
(include "globals.clj") | |
(def c-subj (atom "")) | |
(def temp1 (atom 0)) | |
(def m1_flag (atom "")) | |
(def m2_flag (atom "")) | |
(def temp3 (atom 0)) | |
(def flag (atom 0)) | |
(def temp2 (atom 0)) | |
(def email-c (mailer {:host "smtp.gmail.com" | |
:port 587 |
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
(defn diff [l1 l2] | |
(let [a (group-by identity l1) | |
b (group-by identity l2)] | |
(mapcat #(repeat | |
(- | |
(count (second %)) | |
(count (get b (key %)))) | |
(key %)) | |
a))) |
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
(defn multiple-trials [m n] | |
( loop [m m acc []] | |
(if (> m 0) | |
(recur (dec m) (conj acc (compute-winnings-for-a-trial n))) | |
acc))) |
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
{ | |
"nil": { | |
"description": "Nothingness (from tiles.yml)", | |
"glyph": " ", | |
"day_color": { | |
"between": [ | |
"black", | |
"black" | |
], | |
"mix": [ |
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
(ns opal.dbpedia | |
(:use [clojure.tools.logging :only [log]]) | |
(:require [clojure.java.io :as io]) | |
(:import [uk.ac.manchester.cs.owl.owlapi.turtle.parser TurtleParser] | |
[org.neo4j.graphdb Label] | |
[org.neo4j.index.lucene.unsafe.batchinsert LuceneBatchInserterIndexProvider] | |
[org.neo4j.unsafe.batchinsert BatchInserters] | |
[org.neo4j.graphdb DynamicRelationshipType])) | |
;; PARSING METHODS |
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
(def queen | |
[:range :no :range :no :range | |
:no :range :range :range :no | |
:range :range :self :range :range | |
:no :range :range :range :no | |
:range :no :range :no :range | |
]) |
NewerOlder