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
#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 | |
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
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; |
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
if board.checkmate?(black_player.color) | |
victory_response(white_player) | |
break | |
end |
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
if move_piece_xy == 's' | |
call_methd | |
return | |
end |
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
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') |
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
(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 |
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
Net::HTTP.start('www.rubyinside.com') do |http| | |
req = Net::HTTP::Get.new('/test.txt') | |
puts http.request(req).body | |
end |
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
Rails.application.routes.draw do | |
resource :articles | |
end |