Skip to content

Instantly share code, notes, and snippets.

@xseano
xseano / sieve.cpp
Created July 1, 2018 17:53
Chapter 4 #13
#include <iostream>
#include "tgmath.h"
// For the sake of not having to prepend datatypes with std:: :P
using namespace std;
int main ()
{
for (int i = 2; i < 100; i++)
for (int o = 2; o * o <= i; o++)
@xseano
xseano / str2int.cpp
Created July 1, 2018 17:51
Chapter 3 #9
#include <iostream>
#include "tgmath.h"
// For the sake of not having to prepend datatypes with std:: :P
using namespace std;
int main()
{
cout << "Enter a numeric integer as a string: ";
string s;
@xseano
xseano / fibonacci.cpp
Created July 1, 2018 17:45
Chapter 5 Fibonacci
#include <iostream>
#include "tgmath.h"
// For the sake of not having to prepend datatypes with std:: :P
using namespace std;
int getFibonacci(int number);
int main()
{
@xseano
xseano / helloWorld.cpp
Created June 7, 2018 00:00
Hello World
#include <iostream>
// For the sake of not having to prepend datatypes with std:: :P
using namespace std;
int main(int argc, const char * argv[])
{
// List of ASCII values to be used in constructing the string
int h = 72;
int e = 101;
@xseano
xseano / final_grade_calc.js
Last active March 7, 2018 19:26
Final Grade Calculator
const prompt = require('prompt');
const decimal_placement = 2.0;
prompt.start()
prompt.get(['current grade (%)', 'target grade (%)', 'final grade worth (%)'], (err, results) =>
{
if (err)
{
console.log(`ERROR: ${err}`);
return;
@xseano
xseano / random_image_generator.html
Created January 13, 2018 02:42
Generates random image from given image_url
<html>
<button onClick="randImage()">Random Profile Picture!</button>
<br>
<br>
Your image URL: <div id="image_url"></div>
<br>
<img id="img"></img>
@xseano
xseano / checkTriples.js
Last active October 24, 2017 21:25
Farkle game for checking triples in rolled die values
const maxNum = 10; // will be maxNum - 1 technically
var diceArr = [
getRanNum(),
getRanNum(),
getRanNum(),
getRanNum(),
getRanNum(),
getRanNum()
];
@xseano
xseano / test.js
Created June 13, 2017 21:08
Multiplier Demo
var posInt = 2;
var negInt = -2;
var multiplier = 2;
for (var i = 1; i < multiplier; i++)
{
negInt += negInt;
posInt += posInt;
}
@xseano
xseano / keybase.md
Created February 3, 2017 02:30
KeyBase Authentication

Keybase proof

I hereby claim:

  • I am xseano on github.
  • I am xseano (https://keybase.io/xseano) on keybase.
  • I have a public key whose fingerprint is B4E1 D2F3 3A91 045E FA6D E451 FBA3 99B5 81C8 FC2D

To claim this, I am signing this object: