marcoconti83 / DiceExpression

A Swift library to simulate dice rolls, as in board games or pen-and-paper role playing games

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DiceExpression Build Status

A Swift library to simulate dice rolls, as in board games or pen-and-paper role playing games. Available as a framework for iOS and OSX, Carthage compatible.

Example usage

do {
	let roll = try DiceExpression("3d6+20").roll()
	print("Result: \(roll.result)")
} catch {
	print("Invalid expression: \(error)")
}

About

A Swift library to simulate dice rolls, as in board games or pen-and-paper role playing games

License:MIT License


Languages

Language:Swift 97.2%Language:Objective-C 2.8%