Web component that randomly displays only one of its child elements.
Fastest random ID and random string generation for Node.js
Express Middleware that provides random X-Powered-By header.
A function to parse floating point hexadecimal strings as defined by the WebAssembly specification
[](https://discord.gg/poimandres)
High-performance Base64 encoder and decoder
Encryption, decryption, and key related utility functions
Generate random numbers from various distributions.
A functional typescript implementation of the PCG family random number generators
TypeScript definitions for d3-random
Simple Module for generating Random Strings
A 2D rectangular bin packing data structure that uses the Shelf Best Height Fit heuristic
A JavaScript model of a Gaussian distribution
URL and cookie safe UIDs
Randominator is an Open Sourced Random (X) Generator written in Javascript. Generate Random Tokens, Strings, and Integers.
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.
Random numbers.
A Pulumi package to safely use randomness in Pulumi programs.
Collection of basic layout algorithms for graphology.
A small implementation of `crypto.getRandomValues` for React Native. This is useful to polyfill for libraries like [uuid](https://www.npmjs.com/package/uuid) that depend on it.
AWS X-Ray ID generator for OpenTelemetry
HasSecureToken provides you an easily way to geneatre uniques random tokens for any model in ruby on rails. **SecureRandom::base58** is used to generate the 24-character unique token, so collisions are highly unlikely.
HasSecureToken provides you an easily way to geneatre uniques random tokens for any model in ruby on rails. **SecureRandom::base58** is used to generate the 24-character unique token, so collisions are highly unlikely.
Easily generate strings supplying a very simple pattern. '10-20:Xn/x/'.generate #>qBstvc6JN8ra. Generate random strings using a regular expression (Regexp): /[a-z0-9]{2,5}w+/.gen . Also generate words in English or Spanish. Perfect to be used in test data factories. Also, validate if a text fulfills a specific pattern or even generate a string following a pattern and returning the wrong length, value... for testing your applications.
Wraps Sox's `play` command, allowing playslists, find, random and time limit. Once a song is playing you can: 'x' to previous 'c' to pause/play 'v' to next 'q' to quit 't' n to set a timer that will pause the music after n minutes
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.
Where applicable, they come with a standard version and a class mix in. Ex: NumberDust.nearest(value) is also available as Integer.pd_nearest == FEATURES/PROBLEMS: Features: * Get random numbers in arbitrary ranges from OpenSSL (without skew due to modulo) Problems: * Need a good way to make sure that the OpenSSL library isn't using a broken PRNG == SYNOPSIS: require 'pixiedust' x = RandomDust.between(10,20)
A command line app able to generate a random word search grid n x n (n: number of rows/number of columns) and find all the words inside it. - The grid letters must be uppercase. - The valid words are defined inside the file dict.txt - The minimum size of a valid word is 3 characters. - The program must detect all possible directions: horizontal, vertical and diagonal. (The words can be on reverse order)
This is an empty gem specifying a list of dependencies for RSence Additionally, you may want to install these gems also, even though they are tested for and auto-installation in tried: - sqlite3 - rmagick You must install a Javascript runtime engine separately, because RubyGems isn't smart enough to allow conditional dependencies. The V8-based NodeJS is recommended: http://nodejs.org/ If you are on OS X, you already have Apple's JavaScriptCore installed, which is fine. Previously, RSence depended on therubyracer, but it was found to be the the culprit for crashing the Ruby VM and the cause of some other random memory corruption issues, so it's not recommended until its maintainers have sorted it out. You may however proceed to use it on your own risk, if the speed gains are worth the instability. More info: http://rsence.org/
# 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.