Skip to content

Instantly share code, notes, and snippets.

#Build console based RPG using all the concepts learned about python
#include items, gold, rooms, randomly generated landscape of rooms, different enemy types, items, shops, map printing, bosses, chests ->
#enemies sometimes dropping things,
#exceptions, dictionaries, tuples, list slices, list comprehensions, map, flighter, lambdas, generators, recurshion, sets
from player import *
from room import *
import random
class Mario{
float w,h,x,y,vx,vy, accelX, accelY, speedLimit, friction, bounce, gravity;
float jumpForce = -5;
boolean isOnGround;
Mario(){
w = 50;
h = 50;
if board.checkmate?(black_player.color)
victory_response(white_player)
break
end
if move_piece_xy == 's'
call_methd
return
end
def create_board
board = Array.new(8) { Array.new(8) { ' ' } }
#setus up black pieces
board[0][0] = Rook.new('black')
board[0][1] = Knight.new('black')
board[0][2] = Bishop.new('black')
board[0][3] = Queen.new('black')
board[0][4] = King.new('black')
board[0][5] = Bishop.new('black')
board[0][6] = Knight.new('black')
(0..3).each do |x|
diag_array = []
3.times { |num| diag_array << flat_grid[x + (num)*7] }
arrays << diag_array
end
(7..10).each do |x|
diag_array = []
3.times { |num| diag_array << flat_grid[x + (num)*7] }
arrays << diag_array
end
Net::HTTP.start('www.rubyinside.com') do |http|
req = Net::HTTP::Get.new('/test.txt')
puts http.request(req).body
end
Rails.application.routes.draw do
resource :articles
end