Giter VIP home page Giter VIP logo

msws's Introduction

MSWS

Overview

The msws package is designed to generate random numbers using the Middle Square Weyl sequence algorithm. This algorithm offers a methodical approach to producing pseudo-random numbers with a focus on simplicity and efficiency. The module offers functionalities to both generate random numbers and seed values necessary for the process.

Getting Started

Installation

pip install msws

Quick Start Example

import msws as m
# msws_rand(change_seed=False, input_seed=False, input_seed_value=None)

print(m.msws_rand()) #prints first random generated number using inbuilt seed generation (seed_gen.py) module
print(m.msws_rand()) #prints second random generated number using the above seed value

#Sequence of random number...
print(m.msws_rand()) #prints third...
print(m.msws_rand()) #prints forth...
print(m.msws_rand())
print(m.msws_rand()) 

Change the seed

You can change the seed value if you want a new random number sequence, It uses inbuilt seed_gen.py module for generation and changing the seed value:

Set change_seed = True: To change the seed value, for generating a new random number sequence. (Default = False)

import msws as m
# msws_rand(change_seed=False, input_seed=False, input_seed_value=None)

#prints first random generated number using changed seed value
print(m.msws_rand(True)) #postional argument to set change_seed = True
print(m.msws_rand()) #prints second random generated number using the changed seed value

#Sequence of random number...
print(m.msws_rand()) #prints third...
print(m.msws_rand()) #prints forth...
print(m.msws_rand())
print(m.msws_rand()) 

Input the seed value

If you want to set your seed value for a random number sequence:

Set input_seed = True: To set the input_seed_value as a RNG seed value, for generating a new random number sequence.
(Default = False)

Note: Enter a 64-bit integer value in input_seed_value that has an irregular patterns of bits, to make sure the good random number sequence is generated.

import msws as m
# msws_rand(change_seed=False, input_seed=False, input_seed_value=None)

#prints first random generated number using input seed value
print(m.msws_rand(False,True,13091206342165455529)) #postional argument to set input_seed = True and input_seed_value = <your seed value>
print(m.msws_rand()) #prints second random generated number using the input seed value

#Sequence of random number...
print(m.msws_rand()) #prints third...
print(m.msws_rand()) #prints forth...
print(m.msws_rand())
print(m.msws_rand()) 

msws's People

Contributors

volcano-dragon avatar

Stargazers

 avatar

Watchers

 avatar

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.