M Assets/Ent/Ent.cs +10 -0
@@ 1,3 1,13 @@
+/*
+ * This source code file is in the public domain.
+ * Permission to use, copy, modify, and distribute this software and its documentation
+ * for any purpose and without fee is hereby granted, without any conditions or restrictions.
+ * This software is provided “as is” without express or implied warranty.
+ *
+ * Original version of this code can be obtained from
+ * http://www.fourmilab.ch/random/
+ */
+
using System;
using System.IO;
using Ent;
M Assets/Implementations/MurmurHash.cs +5 -5
@@ 1,10 1,9 @@
/***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ * Version: MPL 2.0/GPL 2.0/LGPL 2.1
*
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
@@ 25,6 24,7 @@
* Rune Skovbo Johansen
* Removing all SQL dependencies (take byte array instead of SqlBinary).
* Adding overload that takes an int array (less code and executes faster).
+ * Adding methods for obtaining random integers or floats in given ranges.
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
M Assets/Implementations/PcgHash.cs +9 -2
@@ 1,3 1,12 @@
+/*
+ * This source code file is in the public domain.
+ * Permission to use, copy, modify, and distribute this software and its documentation
+ * for any purpose and without fee is hereby granted, without any conditions or restrictions.
+ * This software is provided “as is” without express or implied warranty.
+ *
+ * Original code by Rune Skovbo Johansen based on code snippet by Adam Smith.
+ */
+
using System;
public static class PcgHash {
@@ 25,5 34,3 @@ public static class PcgHash {
return (x << b) ^ (x >> (32-b)); // broken rotate because I'm in java and lazy
}
}
-
-
M Assets/Testing/Extensions.cs +12 -3
@@ 1,17 1,26 @@
-using System;
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * The Initial Developer of the Original Code is Rune Skovbo Johansen.
+ * Portions created by the Initial Developer are Copyright (C) 2015
+ * the Initial Developer. All Rights Reserved.
+ */
+
+using System;
public static class Extensions {
public static string Ordinal (this int num) {
if (num < 0)
return num.ToString();
-
+
switch (num % 100) {
case 11:
case 12:
case 13:
return num + "th";
}
-
+
switch (num % 10) {
case 1:
return num + "st";
M Assets/Testing/RandomHashTest.cs +9 -0
@@ 1,3 1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * The Initial Developer of the Original Code is Rune Skovbo Johansen.
+ * Portions created by the Initial Developer are Copyright (C) 2015
+ * the Initial Developer. All Rights Reserved.
+ */
+
using System;
using System.Diagnostics;
using System.Collections.Generic;
M Assets/Testing/RandomHashTester.cs +9 -0
@@ 1,3 1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * The Initial Developer of the Original Code is Rune Skovbo Johansen.
+ * Portions created by the Initial Developer are Copyright (C) 2015
+ * the Initial Developer. All Rights Reserved.
+ */
+
using System;
using System.Collections.Generic;
using System.Security.Cryptography;
M Assets/UnityFrontend/NoiseTestMB.cs +9 -0
@@ 1,3 1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * The Initial Developer of the Original Code is Rune Skovbo Johansen.
+ * Portions created by the Initial Developer are Copyright (C) 2015
+ * the Initial Developer. All Rights Reserved.
+ */
+
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
A => readme.md +24 -0
@@ 0,0 1,24 @@
+# Random Numbers Testing
+
+This repository contains a C# implementation of MurmurHash3 modified to be more suitable for procedural generation, as well as C# code for a random numbers testing framework.
+
+The front-end part of the random numbers testing framework is based on Unity and requires Unity 4.6 or later, while the backend and the MurmurHash3 implementations have no dependencies on Unity.
+
+## MurmurHash3 implementation
+
+MurmurHash3 is a random hash function with very good randomness properties and good performance. The implementation in this repository has been modified to be more suitable for procedural generation:
+
+* Adding overload that takes an int array (less code and executes faster).
+* Adding methods for obtaining random integers or floats in given ranges.
+
+## Random numbers testing framework
+
+The contained random numbers testing framework can be used to assess the quality of randomness for random number generators and random hash functions.
+
+The framework is divided into a frontend part which runs on top of the Unity engine (version 4.6 or later) and a backend part which does not rely on the Unity editor or API.
+
+## License
+
+Most files in the repository are licensed under the Mozilla Public License, v. 2.0. A few files are in the public domain and thus have no restrictions on their use. See the individual files for details.
+
+A copy of the MPL can be obtained at [http://mozilla.org/MPL/2.0/](http://mozilla.org/MPL/2.0/).