Skip to content

Instantly share code, notes, and snippets.

def banner
File.open("banner.txt").each do |line|
puts line
end
end
banner
#super player/AI class
class Gamesuper
@CodePint
CodePint / text_adv.rb
Created December 7, 2017 21:35
text_adv_classselect.rb
## Text Adventure ##
=begin
Project Mission
***********************
NPC/Player creation
- Create races
- Create classes
- Create NPC
- Create Mobs
***********************
So in this program, allow the user to input the amount of sides on a dice and how many times it should be rolled.
From there, your program should simulate dice rolls and keep track of how many times each number comes up (this does not have to be displayed).
After that, print out how many times each number came up.
Subgoal
Adjust your program so that if the user does not type in a number when they need to,
the program will keep prompting them to type in a real number until they do so.
Put the program into a loop so that the user can continue to simulate dice rolls without having to restart the entire program.
@CodePint
CodePint / number_rand_roll.rb
Created December 11, 2017 21:08
number_rand_roll
##random number
=begin
Goal
By using the random module, python can do things like pseudo-random number generation.
So in this program, allow the user to input the amount of sides on a dice and how many times it should be rolled.
From there, your program should simulate dice rolls and keep track of how many times each number comes up (this does not have to be displayed).
After that, print out how many times each number came up.
@CodePint
CodePint / number_rand_roll.rb
Created December 11, 2017 21:09
number_rand_roll
##random number
=begin
Goal
By using the random module, python can do things like pseudo-random number generation.
So in this program, allow the user to input the amount of sides on a dice and how many times it should be rolled.
From there, your program should simulate dice rolls and keep track of how many times each number comes up (this does not have to be displayed).
After that, print out how many times each number came up.
@CodePint
CodePint / number_rand_roll.rb
Created December 11, 2017 21:09
number_rand_roll
##random number
=begin
Goal
By using the random module, python can do things like pseudo-random number generation.
So in this program, allow the user to input the amount of sides on a dice and how many times it should be rolled.
From there, your program should simulate dice rolls and keep track of how many times each number comes up (this does not have to be displayed).
After that, print out how many times each number came up.
@CodePint
CodePint / ruby_test.rb
Created December 11, 2017 21:12
rubytest00
##random number
=begin
Goal
By using the random module, python can do things like pseudo-random number generation.
So in this program, allow the user to input the amount of sides on a dice and how many times it should be rolled.
From there, your program should simulate dice rolls and keep track of how many times each number comes up (this does not have to be displayed).
After that, print out how many times each number came up.
##random number
=begin
Goal
By using the random module, python can do things like pseudo-random number generation.
So in this program, allow the user to input the amount of sides on a dice and how many times it should be rolled.
From there, your program should simulate dice rolls and keep track of how many times each number comes up (this does not have to be displayed).
After that, print out how many times each number came up.
@CodePint
CodePint / rubytest222.rb
Created December 11, 2017 21:40
rubystycheck
##random number
=begin
Goal
By using the random module, python can do things like pseudo-random number generation.
So in this program, allow the user to input the amount of sides on a dice and how many times it should be rolled.
From there, your program should simulate dice rolls and keep track of how many times each number comes up (this does not have to be displayed).
After that, print out how many times each number came up.
##Turn based ruby game
=begin
GOAL
Write a simple game that allows the user and the computer to take turns selecting moves to use against each other.
Both the computer and the player should start out at the same amount of health (such as 100),
and should be able to choose between the three moves:
The first move should do moderate damage and has a small range (such as 18-25).