a random point generator
A function to parse floating point hexadecimal strings as defined by the WebAssembly specification
Returns a X, Y random point that is enclosed within the provided shape
Takes a set of points and partition them into clusters according to DBSCAN's data clustering algorithm.
Creates an interpolated grid of points using the Inverse Distance Weighting method.
Generates random points, lines, or polygons for testing.
Takes a set of points and creates a Triangulated Irregular Network.
Finds a random point inside a circle(s).
Generate random numbers from various distributions.
Pick a random point in a triangle
Picks a random point from within a redius around an address
TypeScript definitions for d3-random
Fastest random ID and random string generation for Node.js
Quadrat analysis lays a set of equal-size areas(quadrat) over the study area and counts the number of features in each quadrat and creates a frequency table.
JavaScript implementation of the XORSHIFT-ADD (XSadd) pseudo random number generator
URL and cookie safe UIDs
Check if the character represented by a given Unicode code point is fullwidth
Use the random function in CSS
An alias package for `crypto.randomBytes` in Node.js and/or browsers
Generate a cryptographically strong random string
Random utility functions for ethers.
Pick a random point on a unit sphere in 3D
Takes a set of points and partition them into clusters using the k-means algorithm.
Generate random (or seeded) names, based on 1990 Census data
Generates random map points, within an optional bounding box.
This gem provides a utility for generating random floating-point numbers within a specified range.
A command-line game with randomized treasure points.
Point GenToken at a database column and it will generate a random and unique key for the field.
Just a game of stooges finding random junk for points and someone wins. YAY!
This is a simple text based Game written in Ruby. It allows the user to create a random action that will affect the players health as well as collecting treasures each round. The highest points after x amount of rounds win.
This is a simple text based Game written in Ruby. It allows the user to create a random action that will affect the players health as well as collecting treasures each round. The highest points after x amount of rounds win.
qrng.anu.edu.au offers true random numbers to anyone on the internet. The random numbers are generated in real-time in our lab by measuring the quantum fluctuations of the vacuum. The vacuum is described very differently in the quantum mechanical context than in the classical context. Traditionally, a vacuum is considered as a space that is empty of matter or photons. Quantum mechanically, however, that same space resembles a sea of virtual particles appearing and disappearing all the time. This result is due to the fact that the vacuum still possesses a zero-point energy. Consequently, the electromagnetic field of the vacuum exhibits random fluctuations in phase and amplitude at all frequencies. By carefully measuring these fluctuations, we are able to generate ultra-high bandwidth random numbers.
studio_game is a command-line game built through instruction by The Pragmatic Studio. Through user input, the game is named and then run through a number of designated rounds. Random play is introduced to assign treasure (points) and increase or decrease a player's health. At the conclusion of the game (as determined by the user) a .txt file is saved with the high scores.
Studio Game Program is meant to add multiple players to a game, and then give or remove health and points based on random rolls of a die. These players also accumulate random treasures that give them bonus points. Included are some other mixins that have weighted die, or players that have higher chances of gaining health and different point values dependent upon their treasures. After many rounds, the stats are printed to see what player came out on top. A great game if you want to bet against random odds with your coworkers that know too much about sports. Getting Started: Just need Ruby to make this baby work. Prerequisites: Computer (preferably a mac), and ruby 2.3.3, plus some of that good ol' worldwide web. License: This project is licensed under the MIT License - see the LICENSE.md file for details Acknowledgments: The Pragmatic Studio, Radbear, God, my parents (probably), spotify mathrock playlists, the movie Swordfish because of that one scene where Halle Berry does that thing to the guy coding, etc.
## YardGame A simple game app created with ruby. ## Table of Contents * [General info](#general-info) * [Technologies](#technologies) * [Setup](#setup) * [Sources](#sources) ## Introduction YardGame was while taking course by Nicole and Mike, the Pragmatic duo. Its a game that allow player earn points on treasures found in the yard. Points are added to the player's health to gain higher scores. It involves a random die roll. ## Technologies * Ruby 3 * Rspec 3 ## Setup To run this project, install it locally. $ gem install yard_game_1.2.0.gem You can load players from the command line in a CSV file. You can also run the game without specifying a player file. A default players.csv file is packaged in the gem. ## Sources This app was inspired by Mike and Nicole Clark of The Pragmatic Studio.
# StudioGame (Alec) Jogo de terminal em Ruby com **jogadores, dados, tesouros e variações de jogadores** (Clumsy e Berserk), empacotado como gem. > Nome do gem (exemplo): `studio_game_alec` --- ## 🚀 Instalação e execução ### Rodando direto do código-fonte No diretório do projeto: ```bash ruby bin/studio_game ``` Se você não passar um arquivo de jogadores via CLI, o script usa o `players.csv` que fica em `bin/` por padrão. Também funciona passando um CSV na linha de comando: ```bash ruby bin/studio_game my_favorite_players.csv ``` ### Como gem (local) Empacote e instale localmente: ```bash gem build studio_game.gemspec gem install studio_game_alec-<versao>.gem ``` Depois rode: ```bash studio_game ``` > No Windows, o executável será resolvido pelo RubyGems. Se preferir, rode: `ruby bin/studio_game`. --- ## 📁 Estrutura do projeto ``` games/ ├─ bin/ │ ├─ studio_game # script principal (tem shebang) │ └─ players.csv # CSV padrão (nome,vida) ├─ lib/ │ └─ studio_game/ │ ├─ auditable.rb │ ├─ berserk_player.rb │ ├─ clumsy_player.rb │ ├─ die.rb │ ├─ game.rb │ ├─ game_turn.rb │ ├─ loaded_die.rb │ ├─ playable.rb │ ├─ player.rb │ └─ treasure_trove.rb ├─ spec/ │ └─ studio_game/ # specs RSpec ├─ LICENSE ├─ README.md └─ studio_game.gemspec ``` - **Namespace:** todo o código vive dentro do módulo `StudioGame` para evitar colisões. - **bin/studio_game:** script CLI com shebang (`#!/usr/bin/env ruby`). Faz _fallback_ do `$LOAD_PATH` para `lib` quando usado fora da gem. - **lib/studio_game/**: código da biblioteca (classes/módulos). - **spec/**: testes RSpec. --- ## 🧩 Conceitos principais - **Player** (`player.rb`): representa um jogador com `name`, `health`, coleta tesouros e calcula `score` (= `health` + `points`). Inclui o mixin **Playable**. - **Playable** (`playable.rb`): mixin com `w00t`, `blam` e `strong?` (altera/consulta `health` via getters/setters). - **TreasureTrove** (`treasure_trove.rb`): define `Treasure = Struct.new(:name,:points)` e a constante `TREASURES`; possui `.random`. - **Die/LoadedDie** (`die.rb`, `loaded_die.rb`): rolam valores (o carregado favorece 1,1,2,5,6,6). Ambos incluem **Auditable**. - **Auditable** (`auditable.rb`): imprime “Rolled a X (DieClass)” após cada rolagem. - **Game** (`game.rb`): agrega jogadores, carrega CSV, executa rodadas, soma pontos e salva _high scores_. - **GameTurn** (`game_turn.rb`): executa a lógica de um turno para um jogador (rola dado, aplica `blam/w00t/skip` e concede tesouro). - **ClumsyPlayer / BerserkPlayer**: variações de `Player` que modificam comportamento de `w00t` e de coleta de tesouros. --- ## 🧪 Testes Rode todos os testes: ```bash rspec ``` Principais coisas testadas: - Ordenação de jogadores por `score` (usa `<=>` em `Player`). - Cálculo de `points` e `score` (soma de tesouros + vida). - Efeitos de `w00t`/`blam` e força (`strong?`). - Lógica de turno com _stubs_ de dado (`allow_any_instance_of(LoadedDie).to receive(:roll).and_return(n)`). - Comportamentos de `ClumsyPlayer` e `BerserkPlayer`. --- ## 📦 CSVs e caminhos - `bin/studio_game` resolve o CSV padrão assim: ```ruby default_player_file = File.join(File.dirname(__FILE__), 'players.csv') game.load_players(ARGV.shift || default_player_file) ``` - Você pode passar um arquivo `.csv` via CLI como primeiro argumento. Formato do CSV: ``` Moe,100 Larry,60 Curly,125 ``` --- ## 🧾 High Scores Após sair do loop, o jogo grava `high_score.txt` com as entradas ordenadas. Cada linha é formatada por `Game#high_score_entry`: ``` <nome com padding de pontos> <score> ``` --- ## 🛠️ Dicas de desenvolvimento - Use `require 'studio_game/arquivo'` quando a gem estiver instalada. - No script binário, o `begin/rescue LoadError` faz _fallback_ para `$LOAD_PATH` local, útil fora da gem. - Para debugar I/O em testes, o spec redireciona `STDOUT` (`$stdout = StringIO.new`). --- ## 📚 Licença MIT – veja o arquivo `LICENSE`.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.