ai-cant-even
Version:
A satirical AI-powered utility that's confidently wrong about basic math operations
72 lines (71 loc) • 4.14 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Example usage of the ai-cant-even package
*
* This demonstrates various ways to use the package with different
* confidence levels and logic types.
*/
const index_1 = require("../index");
// Function to run examples
function runExamples() {
return __awaiter(this, void 0, void 0, function* () {
console.log('🧠 AI CANT EVEN - EXAMPLES 🧠\n');
// Example 1: Basic usage with default settings
console.log('Example 1: Basic usage with default settings');
const basicAi = (0, index_1.aiCantEven)();
console.log(yield basicAi.isEven(4));
console.log(yield basicAi.isOdd(7));
console.log('\n---\n');
// Example 2: Using different confidence levels
console.log('Example 2: Using different confidence levels');
const overwhelmedAi = (0, index_1.aiCantEven)({ confidence: index_1.Confidence.OVERWHELMED });
const overthinkAi = (0, index_1.aiCantEven)({ confidence: index_1.Confidence.OVERTHINK });
const smugAi = (0, index_1.aiCantEven)({ confidence: index_1.Confidence.SMUG });
const snarkyAi = (0, index_1.aiCantEven)({ confidence: index_1.Confidence.SNARKY });
console.log('OVERWHELMED:', yield overwhelmedAi.isEven(3));
console.log('OVERTHINK:', yield overthinkAi.isEven(3));
console.log('SMUG:', yield smugAi.isEven(3));
console.log('SNARKY:', yield snarkyAi.isEven(3));
console.log('\n---\n');
// Example 3: Using different logic types
console.log('Example 3: Using different logic types');
const simpleAi = (0, index_1.aiCantEven)({ logic: index_1.Logic.SIMPLE }); // Default
const nonsequiturAi = (0, index_1.aiCantEven)({ logic: index_1.Logic.NONSEQUITUR });
const pseudomathAi = (0, index_1.aiCantEven)({ logic: index_1.Logic.PSEUDOMATH });
const visualAi = (0, index_1.aiCantEven)({ logic: index_1.Logic.VISUAL });
console.log('SIMPLE:', yield simpleAi.isOdd(2));
console.log('NONSEQUITUR:', yield nonsequiturAi.isOdd(2));
console.log('PSEUDOMATH:', yield pseudomathAi.isOdd(2));
console.log('VISUAL:', yield visualAi.isOdd(2));
console.log('\n---\n');
// Example 4: Using the fluent API
console.log('Example 4: Using the fluent API');
const fluentAi = (0, index_1.aiCantEven)();
console.log(yield fluentAi.withConfidence(index_1.Confidence.SNARKY).withLogic(index_1.Logic.VISUAL).isEven(42));
console.log(yield fluentAi.withConfidence(index_1.Confidence.OVERTHINK).withLogic(index_1.Logic.PSEUDOMATH).isOdd(13));
console.log('\n---\n');
// Example 5: Other math operations
console.log('Example 5: Other math operations');
const mathAi = (0, index_1.aiCantEven)();
console.log('isPrime:', yield mathAi.isPrime(17));
console.log('isPositive:', yield mathAi.isPositive(-3));
console.log('isDivisibleBy:', yield mathAi.isDivisibleBy(15, 3));
console.log('isGreaterThan:', yield mathAi.isGreaterThan(10, 5));
console.log('isLessThan:', yield mathAi.isLessThan(3, 8));
console.log('areEqual:', yield mathAi.areEqual(5, 5));
console.log('isNumber:', yield mathAi.isNumber('42'));
console.log('isInteger:', yield mathAi.isInteger(3.14));
});
}
// Run the examples
runExamples().catch(console.error);