Skip to content

Instantly share code, notes, and snippets.

View dominathan's full-sized avatar

Nathan Hall dominathan

View GitHub Profile
@dominathan
dominathan / taskqueue.js
Last active June 13, 2021 14:48
taskqueue.js
const EventEmitter = require('events')
class TaskQueue {
constructor(concurrent) {
this.concurrent = concurrent || 1
this.unprocessed = []
this.processing = []
this.processingCount = 0
this.eventEmitter = new EventEmitter()
this.eventEmitter.on('processed', () => {

Keybase proof

I hereby claim:

  • I am dominathan on github.
  • I am dominathan (https://keybase.io/dominathan) on keybase.
  • I have a public key ASCAPpfKwHe7lm1-aVEvKXZDpIsBJ_KUBBT8QdIiChMNmAo

To claim this, I am signing this object:

#Question 1.
#Fix the code so it runs
def multiply(a b)
a * b
end
#-----------------------------------------------------
#Question 2
class Deck
attr_reader :cards
def initialize
#ACES == 11 || 1, However, there are only 4 of them.
#FACE/10 CARDS - there are 16 of them total
#You can check the total number of cards by call @cards.count to make sure you have 52
aces = [11] * 4
face = [10] * 16
#You are currently shuffling only the face cards. You will need to wrap them all in parentheses to shuffle them all.
puts "Welcome to Blackjack!"
class BlackJack
def initialize
@player = Player.new
end
def play
while @player.money > 10 do
puts "Welcome to Blackjack!"
class Blackjack
def initialize
@player = Player.new
end
def play
#When you call @player.cards.money, you are asking Ruby to determine how much money the cards have.
# You just Ruby to determine how much money the player has.