Skip to content

Instantly share code, notes, and snippets.

##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.
@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 / 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.
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 / 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
***********************
def banner
File.open("banner.txt").each do |line|
puts line
end
end
banner
#super player/AI class
class Gamesuper