Skip to content

Instantly share code, notes, and snippets.

View stevenvelozo's full-sized avatar

Steven Velozo stevenvelozo

  • Greater Seattle Area
View GitHub Profile
/*
* 1. variables:
* x_is_odd
* odd_or_not
* x
*
* 2. inputs:
* the integer x
*
* 3. determine whether or not the integer x is odd or even
/*
* Homework.java
*
* Version: 1.0
*
* 1: Take an integer input from the user.
* Value of x
* 2: Determine if the number is even or odd.
* Value of x_is_odd
* 3: Display the number and whether it is even or odd to the user.
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
// Display the console graph using a log scale, so elements don't blow out with huge set values
var _BarGraphicCache = '';
var generateBar = function(pValue, pAmount, pMax, pWidth)
{
var tmpBarRenderAmount = pAmount;
if (pMax > pWidth)
{
tmpBarRenderAmount = Math.log(pAmount) / (Math.log(pMax) / pWidth);
}