Skip to content

Instantly share code, notes, and snippets.

View JuggernOtt81's full-sized avatar
💭
Building an app for a niche business.

Lawson Ott JuggernOtt81

💭
Building an app for a niche business.
View GitHub Profile
privacy policy: there is none. do not expect any at this time. please do NOT use this app if you do not agree. as the developer, i do not intend to use or distribute any of your information at this time. however, this is a beta program and may have bugs. i/we are not responsible for any data/information you may lose, leak, share using this app.
using System;
using System.IO;
namespace AoC2017Day2Part2
{
class Program
{
private const string Path = @"C:\Users\...\AoC2017Day2Part2\Input.txt";
static void Main(string[] args)
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AoC2017Day2Part1
{
class Program
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AoC2017Day1Part2
{
class Program
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AoC2017Day1Part1
{
class Program
{
@JuggernOtt81
JuggernOtt81 / chunky monkey - alt.js
Last active May 25, 2018 20:26
splitting array into sub array (alt style)
var myArr = [];
function chunkArrayInGroups(arr, size)
{
var s = size;
var temp = arr;
var sub = [];
var div = (arr.length/size);
var a = 0;
var b = 0;
while(a < div)
@JuggernOtt81
JuggernOtt81 / TitleCase.js
Created May 18, 2018 15:09
give a string title casing
function titleCase(str) {
str = str.toLowerCase();
var arrayOfWords = str.split(" ");
var titleArr = [];
var returnString = "";
for (var i = 0; i < arrayOfWords.length; i++) {
titleArr[i] = arrayOfWords[i].replace(/^\w/, function (c) {
return c.toUpperCase();
});
@JuggernOtt81
JuggernOtt81 / palindrome.js
Created May 18, 2018 12:25
my palindrome checker
function palindrome(str)
{
str = str.toLowerCase();
str = str.replace(/[\W_]/g, "");
var a = str;
var arr = str.split('');
var newArr = arr.reverse();
var b = newArr.join("")
console.log("a = " + a + ". b = " + b + ".");
if (a == b)
// A Pythagorean triplet is a set of three natural numbers, a < b < c, for which,
//
// a2 + b2 = c2
// For example, 3^2 + 4^2 = 9 + 16 = 25 = 5^2.
//
// There exists exactly one Pythagorean triplet for which a + b + c = 1000.
// Find the product abc.
let a = 1;
let b = 1;
// The sum of the squares of the first ten natural numbers is,
// 12 + 22 + ... + 102 = 385
// The square of the sum of the first ten natural numbers is,
//
// (1 + 2 + ... + 10)2 = 552 = 3025
// Hence the difference between the sum of the squares of the first ten natural
// numbers and the square of the sum is 3025 − 385 = 2640.
//
// Find the difference between the sum of the squares of the first one hundred
// natural numbers and the square of the sum.