dfhack fork
 
 
 
 
 
 
Go to file
Josh Cooper 23b2d5eba5 Merge branch cxxrandom
Implements helper functions for random number generation.
Implemented using C++11 <random> library.

Exported Lua Functions:
- seedRNG(seed)
- rollInt(min, max)
- rollDouble(min, max)
- rollNormal(mean, std_deviation)
- rollBool(chance_for_true)
- resetIndexRolls(string, array_length)  --String identifies the instance of SimpleNumDistribution to reset
- rollIndex(string, array_length)        --String identifies the instance of SimpleNumDistribution to use
                                         --(Shuffles a vector of indices, Next() increments through then reshuffles when end() is reached)

 On branch cxxrandom-rel
 Changes to be committed:
   modified:   plugins/CMakeLists.txt
   new file:   plugins/cxxrandom.cpp
   new file:   plugins/lua/cxxrandom.lua

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Squashed commit of the following:

commit 3a7ef70d45f3e0c2fe367141dd0349dddaaff60d
Merge: fd9f1982 7aa0608c
Author: Josh Cooper <cooper.s.josh@gmail.com>
Date:   Fri Dec 22 22:17:27 2017 -0800

    Merge remote-tracking branch 'origin/temp' into cxxrandom

commit 7aa0608cb85dcf82686193db7a6e9d1318f5f2a5
Author: Josh Cooper <cooper.s.josh@gmail.com>
Date:   Thu Dec 21 21:43:35 2017 -0800

    Revises cxxrandom plugin

    New functions:
    - seedRNG(ushort seed)
        --lua exported
    - GetDistribContainer()
        --internal singleton
    - RNG()
        --internal singleton

    Summary:
    - Removed class CXXRNG
        --Refactored functions that used CXXRNG

     Changes to be committed:
            modified:   plugins/cxxrandom.cpp

commit b42979818a01c1121eace7b1ac14676f5ad5d8b2
Author: Josh Cooper <cooper.s.josh@gmail.com>
Date:   Wed Dec 20 13:21:49 2017 -0800

    Fixes plugin_init()

    Misread the lines indicated by lethosor to be excluded, had broken the plugin in the process.
     Changes to be committed:
    	modified:   plugins/cxxrandom.cpp

commit 753a00a14d9e6519d299638e014abf30509940af
Author: Josh Cooper <cooper.s.josh@gmail.com>
Date:   Wed Dec 20 12:36:17 2017 -0800

    Cleans up cxxrandom.cpp

    DFHack contributions specifies:
    -spaces instead of tabs, so tabs were converted.
    -C++ headers before dfhack stuff, so it was done

    *Also added author name, creation date, and last updated date.

     Changes to be committed:
    	modified:   plugins/cxxrandom.cpp

commit 498ebe4b8fdccc01ac1f169269f3093c830a8a10
Author: Josh Cooper <cooper.s.josh@gmail.com>
Date:   Tue Dec 19 22:51:58 2017 -0800

    Updates cxxrandom, fixes instance leak

    deleted header
    moved definition to cpp file #lethosor

    fixed singleton instance, no longer a pointer
    commented out dfhack commands, now only init/shutdown and exported lua functions

    	modified:   cxxrandom.cpp
    	deleted:    cxxrandom.h

commit 821044bef2a0201d0d74192e445c7b29766b42a1
Author: Josh Cooper <cooper.s.josh@gmail.com>
Date:   Sun Dec 17 04:01:11 2017 -0800

    Fixes RollIndex and Renames RollNormal

    Renamed the Normal Distribution RNG function to fit the standard.
    Now named RollNormal(m,s)

    Fixed some wonky white space in the lua macro export block.

    Fixed a stupid mistake with the RollIndex output. (it was outputting 0's)

    Updated usage details.

     Changes to be committed:
    	modified:   plugins/cxxrandom.cpp

commit 1536f43d137b6bc55d55759b43bdccf6ff429b33
Author: Josh Cooper <cooper.s.josh@gmail.com>
Date:   Fri Dec 15 08:50:08 2017 -0800

    Fixes/Improves cxxrandom

    Modified return types
    Corrected index distribution code

commit 8629c7e1509522cb0cc4b649914b90d033cb4763
Author: Josh Cooper <cooper.s.josh@gmail.com>
Date:   Thu Dec 14 19:02:29 2017 -0800

    Implements SimpleNumDistribution

    Exported additional functions to lua.
    Functions allow the generation of random 0-N index values.
    Generation promises all unique values [0,N] will be returned once each when generation is run N times.

     On branch cxxrandom
     Changes to be committed:
    	modified:   plugins/cxxrandom.cpp
    	modified:   plugins/cxxrandom.h

commit f035f3d20415790542cf83e5e696261661d911f3
Author: Josh Cooper <cooper.s.josh@gmail.com>
Date:   Wed Dec 13 23:55:39 2017 -0800

    Implements cxxrandom

    cxxrandom was implemented using a singleton.
    This singleton provides an interface for generating uniform numbers, or numbers in a normal distribution, and also booleans(given the probability for the true outcome)
    The singleton interface is wrapped in functions which are exposed for lua usage.

    Integrated into plugins/CMakeLists.txt

     On branch dev
     Changes to be committed:
    	modified:   CMakeLists.txt
    	new file:   cxxrandom.cpp
    	new file:   cxxrandom.h
    	new file:   lua/cxxrandom.lua
2018-04-29 21:08:44 -07:00
CMake Remove several unused CMake and Doxygen files 2017-05-11 22:01:57 -04:00
build Remove obsolete settings from Windows build scripts, plus misc. updates 2017-03-01 20:29:46 -05:00
depends Fix compile errors on Ubuntu 18.04 Bionic Beaver 2018-03-08 11:42:58 -06:00
dfhack-config Add default script-paths.txt 2016-03-31 23:00:25 -04:00
docs Update changelog (OS X GCC, bump version) 2018-04-04 20:07:41 -04:00
library Install the correct libstdc++ 2018-04-04 20:01:27 -04:00
package Add downloads for OS X GCC 7 stdlib 2018-04-04 19:45:44 -04:00
plugins Merge branch cxxrandom 2018-04-29 21:08:44 -07:00
reversing Properly handle the variety of exception handlers that MSVC 2010 generates 2012-03-03 14:14:31 -06:00
scripts@7d7dd8a749 Update scripts (dfhack/scripts#50) 2018-04-03 11:31:14 -04:00
test Add test runner 2018-02-04 16:00:53 -05:00
travis Add test runner 2018-02-04 16:00:53 -05:00
.gitignore Ignore df_path. again. 2016-10-19 20:00:56 +05:30
.gitmodules Re-add the scripts submodule, with a different internal name 2016-06-29 19:07:45 -04:00
.travis.yml Re-enable IRC notifications 2018-02-05 19:22:07 -05:00
.ycm_extra_conf.py Enable ycmd for project 2016-01-26 20:37:27 -05:00
CMakeLists.txt Bump to 0.44.09-r1 2018-04-04 22:45:34 -04:00
Contributing.rst Document changelog process 2018-04-02 22:22:20 -04:00
LICENSE.rst Further clarify Core; move plugins out; other fixes 2015-11-06 11:44:43 +11:00
README.html Fix html redirection to the docs 2016-04-11 09:30:05 +10:00
README.md Fix forum thread link in README.md 2017-06-20 23:47:04 -07:00
conf.py Ensure that docs/_auto/ exists 2018-04-02 14:14:03 -04:00
dfhack.init-example Make tweak pausing-fps-counter non-default for now 2018-02-12 01:48:09 -05:00
index.rst Add a script to automatically generate both changelogs from a single file 2018-04-02 13:43:32 -04:00
onLoad.init-example Remove warn-stuck-trees from onLoad.init-example 2017-12-23 20:49:24 -05:00

README.md

DFHack Readme

Build Status Documentation Status License Github Issues Open Pulls

DFHack is a Dwarf Fortress memory access library, distributed with scripts and plugins implementing a wide variety of useful functions and tools.

The full documentation is available online here, from the README.html page in the DFHack distribution, or as raw text in the ./docs folder. If you're an end-user, modder, or interested in contributing to DFHack - go read those docs.

If that's unclear or you need more help, try the Bay12 forums thread or the #dfhack IRC channel on freenode.