Instantly share code, notes, and snippets.

🎯
Focusing

# Dawlin Peña Lucianodluciano

🎯
Focusing
• Sort options
Last active May 19, 2019
Optimization. Calculate the triangles only in the setup func
View sierpinski.js
 function equilateral(points) { const self = this; self.points = points; self.draw = function(stokeColor) { if (!points || points.length < 3) return; push(); fill(255); stroke(stokeColor);
Last active Jun 21, 2018
NumberToWords - C#
View NumberToWords.cs
 //Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester {
Created Jan 29, 2018
Verify balanced brackets, parenthesis and others.
View balanced.c
 #include #include #include #include #define IGNORE 0 #define OPEN 1 #define CLOSE 2 int isOpenChar(char c){
Created Jul 27, 2017
Reverse polish notation algo
View index.html
 RPN
Created Jul 25, 2017
Recipe with base 2 in c#
View recipe_base2.cs
 using System; public class Test { public static void Main() { int[] recetas = {1,2,4,8,16,32,64,128}; int X = 17; Console.Write("Tenemos una receta de: "); for(var z = X; z >= 1; ){
Created May 23, 2017
Int to Bit - C#
View intToBit.cs
 using System; class MainClass { public static void ToBin(int N){ int[] t = new int[32]; bool isNeg = N < 0; N = Math.Abs(N); int i = 0; while(N >= 1){ t[i] = N%2; i++;
Created May 23, 2017
Palindrome Recursive - Python 3
View palindromeR.py
 def palindromeR(text): M = len(text) if(M <= 1): return True return (text[0] == text[M - 1]) and palindromeR(text[1: M - 1]) n = "racecare" isP = palindromeR(n) print(isP)
Created May 23, 2017
Palindrome - Python
View palindrome.py
 def palindrome(text): M = len(text) if(M <= 0): return False i = 0 text = text.lower() while(i < M): if(text[i] != text[M - 1 - i]): return False
Last active May 23, 2017
Palindrome - C#
View palindrome.cs
 using System; public class Test { public static bool Palindrome(string text){ if(string.IsNullOrWhiteSpace(text)) return false; text = text.ToLower(); for(int i = 0; i < text.Length / 2; i++){ if(text[i] != text[text.Length - 1 - i])
Last active May 23, 2017
Sum of N - Recursive Py3
View sumOfN.py
 def sum(arr): if len(arr) == 0: return 0 return arr[0] + sum(arr[1:len(arr)]) s = sum([1,2,3,4,5]) print(s)
You can’t perform that action at this time.