Skip to content

Instantly share code, notes, and snippets.

@DeeJayhX
DeeJayhX / odds.rb
Last active May 6, 2017 01:52
There's gotta be a better way to write this logic...
# Pretend the addLog's are puts with the message for the sake of sanity
instant_crash_percentage = 5
remaining = 100 - instant_crash_percentage
odds = SecureRandom.random_number(1..100)
puts odds
case odds
when 1..instant_crash_percentage
@DeeJayhX
DeeJayhX / this.css
Last active May 6, 2017 21:34
Can be condensed to one class?
.menu1{
li {
text-align: left;
border-bottom: 1px solid #555;
}
li a {
display: block;
color: #000;
padding: 8px 16px;
class Roulette
def betting
print "betting1"
roll
end
def roll
print "roll1"
betting
end
end
require 'thread'
Thread.abort_on_exception = true
def addLog(x,y)
print x
puts y
end
def procA()
addLog("Stuff1", "Thing1")
def addLog( msg, type=0, game=0, write_to_file=$file_log )
#Type: 0=Info, 1=Warning, 2=Error, 3=Debug, 4=Start, 5=Stop
#Game: 0=None, 1=Roulette, 2=Crash
Console.write Time.now.strftime("%H:%M:%S"), :white
case type
when 0
Console.write "|Info: ", :white
when 1
local component = require("component");
local fs = require("filesystem");
local serialization = require("serialization");
local term = require("term");
local internet = nil;
--[[
--]]
local packages = {"oop", "libGUI", "draconic_control", "dc_gui"};
$ ls -alR /etc/gdm3/
/etc/gdm3/:
total 24
drwxr-xr-x 4 root root 4096 Jun 2 01:45 .
drwxr-xr-x 135 root root 12288 Jun 2 01:43 ..
drwxr-xr-x 2 root root 4096 Jun 2 01:45 Init
drwxr-xr-x 2 root root 4096 Jun 2 01:45 PostLogin
/etc/gdm3/Init:
total 12
var arr = [];
var dHand = [];
var pHand = [];
var dSum = 0;
var pSum = 0;
while ( dHand.length < 2)
{
arr = randCard();
dHand.push(arr[0]);
function checkAces(arr, sum)
{
if ( arr.includes("A") )
{
if ( sum + 10 < 22 )
{
sum += 10;
}
}
@DeeJayhX
DeeJayhX / add.py
Last active January 20, 2019 04:35
### Super inefficient adding algorithm
### By: Derek Steindel
#set variables
##STEP 1
carry = 0
##STEP 2
i = 0
result = ""