Skip to content

Instantly share code, notes, and snippets.

View test0n3's full-sized avatar
🏠
Working from home

Carlos A. test0n3

🏠
Working from home
View GitHub Profile
@test0n3
test0n3 / get_schedule.rb
Created May 2, 2023 17:20
Procedure to get the schedule (main date) from https://holamundo.day/
# frozen_string_literal: true
require 'uri'
require 'net/http'
require 'nokogiri'
# class GetSchedule, get on date schedule
class GetSchedule
HOLAMUNDO_URL = 'https://holamundo.day/'
@test0n3
test0n3 / hangman_test.rb
Created April 8, 2023 16:22
Test for hangman.rb, using Minitest
# frozen_string_literal: false
gem 'minitest', '~> 5.4'
require 'minitest/autorun'
require 'minitest/pride'
require_relative './test0n3'
# class for testing
class HangmanTest < Minitest::Test
EXAMPLE_WORD = 'television'
@test0n3
test0n3 / hangman.rb
Created April 8, 2023 16:15
Code for the game Hangman in Ruby
# frozen_string_literal: false
# class for game Hangman
class Hangman
def initialize(original_word)
@original_word = original_word
@game_initial_data = game_preparation
@game_word = @game_initial_data[:game_word]
@missing_chars = @game_initial_data[:missing_chars]
@attempts = set_attempts