This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### Fahrenheit to Celsius | |
def convert(f) | |
c = ((f.to_i-32)*(5.0/9.0)) | |
c = (c * 10).round * 0.1 | |
end | |
puts "Convert Fahrenheit to Celsius." | |
print "Input the Fahrenheit: " | |
f = gets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### Adds | |
puts "Adds n + (n-x)." | |
#print "Input an integer number: " | |
#n = gets | |
n = 5 | |
(n).downto(0) do |a| | |
x = n-a | |
break if a < x | |
puts "#{a} + #{x} = #{a+x}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### Perfect Number | |
puts "This is the perfect number." | |
x = 30 | |
(x).times do |n| | |
(n).downto(1) do |a| | |
#puts "a: #{a}" | |
d = 0 | |
(1..a).each do |b| | |
if a % b == 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'test/unit' | |
extend Test::Unit::Assertions | |
FIRST_TEN = ["zero ", "one ", "two ", "three ", "four ", "five ", "six ", "seven ", "eight ", "nine "] | |
SECOND_TEN = ["ten ", "eleven ", "twelve ", "thirteen ", "fourteen ", "fifteen ", "sixteen ", "seventeen ", "eighteen ", "nineteen "] | |
OTHER_TENS = ["", "", "twenty ", "thirty ", "forty ", "fifty ", "sixty ", "seventy ", "eighty ", "ninety "] | |
HUNDRED = "hundred " | |
def number2text(number) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# | |
# Strict and warnings are recommended. | |
use strict; | |
use warnings; | |
use Cwd; | |
use File::Find; | |
my $base_path = Cwd::cwd . '/'; | |
my $path = $base_path . 'pwndbg/'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash +xv | |
echo -e "~~~~~~~~~~~ START THE SERVICE TO RUN REFLECTOR ~~~~~~~~~~~" | |
echo "" | |
while [ 1 ] | |
do | |
if ping -c 1 google.com >> /dev/null 2>&1 | |
then | |
echo -e "~~~~~~~~~~~ RUN THE REFLECTOR PACKAGE ~~~~~~~~~~~" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
USERNAME="my_user" | |
REPOSITORY="the_repo" | |
TOKEN="ghp_github_token permissions: repo, workflow" | |
WORKFLOW_RUNS=$( | |
curl \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
--silent \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Handle all the player class | |
""" | |
class EnemyPlayer: | |
""" | |
Handler the enemy player | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Esta funcion simula el juego al perder dinero pero esta programada con funciones | |
""" | |
def decrease_money(money: int, amount: int): | |
""" | |
Decrease player money given an amount. | |
:type money: int | |
:param money: Total of money |
OlderNewer