This file contains hidden or 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 SpaceStation | |
attr_reader :sensors, :supply_hold, :fuel_tank, :thrusters | |
def initialize | |
@supply_hold = SupplyHold.new | |
@sensors = Sensors.new | |
@fuel_tank = FuelTank.new | |
@thrusters = Thrusters.new(@fuel_tank) | |
end | |
end |
This file contains hidden or 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 SpaceStation | |
def initialize | |
@supplies = {} | |
@fuel = 0 | |
end | |
def run_sensors | |
puts "----- Sensor Action -----" | |
puts "Running sensors!" | |
end |
This file contains hidden or 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; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
NobleGas argon = new NobleGas("Argon", "Ar", 18); | |
argon.Describe(); | |
} | |
This file contains hidden or 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 Element | |
attr_accessor :name, :symbol, :number | |
def initialize(name, symbol, number) | |
self.name = name | |
self.symbol = symbol | |
self.number = number | |
end | |
def describe |
This file contains hidden or 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; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
Element hydrogen = new Element("Hydrogen", "H", 1); | |
hydrogen.Describe(); | |
} | |
This file contains hidden or 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 Element | |
attr_accessor :name, :symbol, :number | |
def initialize(name, symbol, number) | |
self.name = name | |
self.symbol = symbol | |
self.number = number | |
end | |
def describe |
This file contains hidden or 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; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
List<String> particles = new List<String>(); | |
particles.Add("electron"); | |
particles.Add("proton"); |
This file contains hidden or 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; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
string[] particles = new string[] { "electron", "proton", "neturon", null, null }; | |
particles.SetValue("muon", 3); |
This file contains hidden or 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; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
string[] particles = new string[] { "electron", "proton", "neturon" }; | |
particles.SetValue("muon", 3); |
This file contains hidden or 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
particles = ["electron", "proton", "neturon"] | |
particles.push("muon") | |
particles.push("photon") | |
particles.each do |particle| | |
puts particle | |
end |