Skip to content

Instantly share code, notes, and snippets.

View RyanBreaker's full-sized avatar

Ryan Breaker RyanBreaker

View GitHub Profile
class Start
{
public static void main(String args[])
{
int a[] = {3,4,5,6,7};
change(a);
for(int i: a)
{
System.out.println(a);
def go(direc):
direcs = ["north",'n', "south",'s', "east",'e', "west",'w']
diags = ["northeast",'ne', "northwest",'nw', "southeast",'se', "southwest",'sw']
if direc in direcs:
if direc == direcs[0] or direc == direcs[1]:
x += 1
elif direc == direcs[2] or direc == direcs[3]:
x -= 1
elif direc == direcs[4] or direc == direcs[5]:
y += 1
(icharacters
Player
p1
(dp2
S'status'
p3
S'dead'
p4
sS'weapons'
p5
towns = ['1', ['1.1', ['1.1.1', '1.1.2', '1.1.3'], '1.2', ['1.2.1', '1.2.2']],
'2', ['2.1', '2.2'], '3']
"""
1
|\
| 1.1
| | \
| | 1.1.1
| | |
@RyanBreaker
RyanBreaker / RockPaperScissors.py
Created October 27, 2012 03:05
Rock, Paper, Scissors game written in Python 2.
import os
from random import randint
from text import text
def printInfo(case):
os.system("cls" if os.name=='nt' else "clear")
if case == "start":
print "Rock, Paper, Scissors!"
print text % (wins, losses, ties)
else:
: |=o=| ." I am a TIE Fighter!" ;
@RyanBreaker
RyanBreaker / warrior.fs
Last active December 15, 2015 00:19
WIP solution to JohnEarnest's Forth Warrior. It looks, acts upon what is there, if it is a floor or stairs it will add that to the 'walkables' var. At 'move' it asks if it needs to think or not (if there's more than one possible path or not) and moves accordingly.
( Current ToDo:
* Fix direction bug when picking up gem
* Figure out how to have it decide where to go when it has more than 1 path
)
: allot loop 0 , 1- dup while drop ;
create walkables 4 allot
create from -1 ,
var n-dirs
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String inputString;
Stack stack = new Stack();
while(true) {
import XCTest
class WordCountTest: XCTestCase {
func XCTAssertEqualDictionaries(first: [String: Int], second: [String: Int]) {
XCTAssertEqual(first, second)
}
func testCountOneWord() {
let words = WordCount(words: "word")
- (IBAction)displayDay:(id)sender {
NSDate *chosen = [self.datePicker date];
NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
[formatter setDateFormat:@"EEEE"];
NSString *day = [formatter stringFromDate:chosen];
NSString *msg = [[NSString alloc] initWithFormat:@"That's a %@.", day];