Code Monkey home page Code Monkey logo

dicek's Introduction

Date of creation: Jul 07, 2015. Last update: Jul 06, 2016.

I once put all of my phpBB extensions into one GitHub respository when I was a GitHub newbie. I am re-committing them for separate repositories.

What is this?

A phpBB extension: DICEK BBCode.

Tested on phpBB 3.1.9.

For more advance dice please visit hanelyp fancy dice extension. DICEK only works with integer and no more.

The difference: My extension saves the dice result into the database so that the user cannot cheat by re-dicing.

Syntax

[dicek]max1-max2-max3-...-maxn[/dicek]

[checkdicek]post_id[/checkdicek]

Result:

[a random number from 1 to max1]-[a random number from 1 to max2]-...-[a random number from 1 to maxn]

POST ID: post_id
Dice Range: max1-max2-max3-...-maxn
Corresponding Dice Result: [a random number from 1 to max1]-[a random number from 1 to max2]-...-[a random number from 1 to maxn]

Example

[dicek]10-20-30-20[/dicek] => 8-11-25-5

[dicek]3[/dicek] => 2

[checkdicek]3[/checkdicek] =>

POST ID: 3
Dice Range: 10-20-30-20
Corresponding Dice Result: 8-11-25-5

Note

Once you submit the post with [dicek]10-20-30-20[/dicek], you can later edit the post into:

First dicek with 30 max: [dicek]30[/dicek]
First dicek with 20 max: [dicek]20[/dicek]
Second dicek with 20 max: [dicek]20[/dicek]

So the result will be:

First dicek with 30 max: 25
First dicek with 20 max: 11
Second dicek with 20 max: 5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.