Create a fortune using Ruby

Introduction

I would like to create a simple Omikuji using Ruby. It is a simple program that outputs the elements of the array at random.

Actual code

 #First, list the types of Omikuji in the array
 omikuji = ["Daikichi","Nakayoshi","Kichi","Bad","大Bad"]

 #Assign the value of the omikuji array randomly pulled out by the sample method to the result variable
 result = omikuji.sample

 #The elements of the array randomly selected from the contents of the omikuji variable are output each time it is executed.
 puts result

          


that's all. If you forget to buy an Omikuji, please use it.

Recommended Posts

Create a fortune using Ruby
[Android] Create a calendar using GridView
Create a Jetty project using Eclipse
Create a tomcat project using Eclipse
Create a Java project using Eclipse
Create a filtering function using acts-as-taggable-on
Create a web environment quickly using Docker
Create a RESTful API service using Grape
Create a prefectural select bar using active_hash
Create a login function using Swift's Optional
How to create a query using variables in GraphQL [Using Ruby on Rails]
[ruby] Create DHT11 / 22 class from scratch using datasheet
[Android] Create a sliding menu without using NavigationView
Let's create a REST API using WildFly Swarm.
[Rails] How to create a graph using lazy_high_charts
Create a Spring Boot application using IntelliJ IDEA
Create a native extension of Ruby in Rust
[Java] Create a filter
Create a portfolio app using Java and Spring Boot
[Ruby] Cut out a string using the slice method
[Introduction] Try to create a Ruby on Rails application
What is a safety reference operator (&.) Using Ruby ampersand?
A memorandum when trying to create a GUI using JavaFX
[Programming complete] §5 Create a review management app in Ruby
Create a login authentication screen using the session function
Ruby Learning # 2 Drawing a Shape
What is a Ruby module?
Try using Cocoa from Ruby
Creating a 2021 weekly calendar (refill for personal organizer) using Ruby
Create a java method [Memo] [java11]
Ruby Learning # 11 Building a Calculator
[Java] Create a temporary file
Statically typed Ruby using Sorbet
Multiplication in a Ruby array
Create a VS Code Plugin.
Create a playground with Xcode 12
Create a tomcat project using Eclipse Pleiades All in One
Ruby Learning # 32 Building a Quiz
I want to create a Parquet file even in Ruby
Try using gRPC in Ruby
Ruby ① Build a Windows environment
I wrote a C parser (like) using PEG in Ruby
Create a MOB using the Minecraft Java Mythicmobs plugin | Preparation 1
[Programming Encyclopedia] §2 Try using Ruby
Make a rhombus using Java
How to create a method
Cut out a Ruby string
Create a name input function
Create a large number of records with one command using the Ruby on Rails seeds.rb file
How to create a jar file or war file using the jar command
Create a memo app with Tomcat + JSP + Servlet + MySQL using Eclipse
[Rails 6] How to create a dynamic form input screen using cocoon
Create a static file that expands variables using the ERB class
[Implementation procedure] Create a user authentication function using sorcery in Rails
Easy way to create a mapping class when using the API
Create a periodical program with Ruby x AWS Lambda x CloudWatch Events
Oracle Cloud [OCI]: Create a CentOS Stream instance using Compute's cloud-init
Create a development environment for Ruby 3.0.0 and Rails 6.1.0 on Ubuntu 20.04.1 LTS
(Ruby on Rails6) Create a function to edit the posted content
Sorting hashes in a Ruby array
Create a Vue3 environment with Docker!