- Number guessing game
- Initial number
- Take it in turns
- Too high/low
- You got it right
- Needs to look professional
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
$debug = false | |
# Creates Program Data References | |
calendar = {"JAN"=>0, "FEB"=>1, "MAR"=>2, "APR"=>3, "MAY"=>4, "JUN"=>5, | |
"JUL"=>6, "AUG"=>7, "SEP"=>8, "OCT"=>9, "NOV"=>10, "DEC"=>11} | |
chart, journal = {}, [] | |
File.open('chart.txt').each { |line| chart[line.split(';')[0]]=line.split(';')[1] } | |
File.open('journal.txt').sort.each { |line| journal << line.chomp.split(';')} | |
# User Instructions + Input |
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 factorial(num) num==0 ? 1 : num * factorial(num-1) end | |
print 'You want the sum of all numbers in a number to be:' | |
n = gets.chomp.to_i | |
print 'You want the largest number to be 10 ^' | |
k_exp = gets.chomp.to_i | |
sigma, mu, n_k_l, k_l = 0, 10, n + k_exp - 1, k_exp - 1 | |
(0..[k_exp, n/mu].min).each do |i| |
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
print "How long are the sides?: " | |
side_length = gets.chomp.to_i | |
if side_length > 0 | |
puts "*" | |
(side_length - 2).times { |i| puts "*" + (" " * i) + "*" } | |
puts "*" * side_length | |
side_length.times { |i| (i+1).times { |n| print (n+1).to_s.rjust(side_length.to_s.length) }; puts } | |
puts " " * (side_length - 1) + "*" |
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
############################################################ | |
# | |
# Name: Dennis Sauve | |
# Date: 04/16/17 | |
# Assignment: Ruby Classes | |
# Class: CIS283 | |
# Description: A Program that implements ruby classes to | |
# store object information. This is an | |
# exercise in learning about the nature of | |
# Classes, and therefore the attr_accessor |
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
require_relative('sea_cell') | |
fin = File.open('map.txt', 'r') | |
dims = fin.readline.strip.split(' ') | |
map = fin.readlines | |
fin.close | |
world = Nemo.new(map, dims) | |
sea_cells = [] | |
map.each_with_index do |latitude, lat| |
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
text = "R4, R4, L1, R3, L5, R2, R5, R1, L4, R3, L5, R2, L3, L4, L3, R1, R5, R1, L3, L1, R3, L1, R2, R2, L2, R5, L3, L4, R4, R4, R2, L4, L1, R5, L1, L4, R4, L1, R1, L2, R5, L2, L3, R2, R1, L194, R2, L4, R49, R1, R3, L5, L4, L1, R4, R2, R1, L5, R3, L5, L4, R4, R4, L2, L3, R78, L5, R4, R191, R4, R3, R1, L2, R1, R3, L1, R3, R4, R2, L2, R1, R4, L5, R2, L2, L4, L2, R1, R2, L3, R5, R2, L3, L3, R3, L1, L1, R5, L4, L4, L2, R5, R1, R4, L3, L5, L4, R5, L4, R5, R4, L3, L2, L5, R4, R3, L3, R1, L5, R5, R1, L3, R2, L5, R5, L3, R1, R4, L5, R4, R2, R3, L4, L5, R3, R4, L5, L5, R4, L4, L4, R1, R5, R3, L1, L4, L3, L4, R1, L5, L1, R2, R2, R4, R4, L5, R4, R1, L1, L1, L3, L5, L2, R4, L3, L5, L4, L1, R3" | |
directions = text.split(", ") | |
ox = 0 | |
dx = 0 | |
oy = 1 | |
dy = 0 |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.EntityFrameworkCore; | |
using MvcMovie.Models; | |
namespace MvcMovie.ApiControllers |
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
<!-- Need this for program to open - Code to be cleansed here --> |
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
/* Notes based on the tutorial here: https://www.youtube.com/watch?v=2Y45vk7d_Bg | |
Covered Here: | |
- Saving to iCloud with CloudKit | |
- Querying iCloud with CloudKit | |
- Pull Motion Refresh | |
- Using a cell programatically instead of dequeing a model | |
Useful for quick coding | |
OlderNewer