Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Dawlin Peña Luciano dluciano

🎯
Focusing
Block or report user

Report or block dluciano

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dluciano
dluciano / sierpinski.js
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);
@dluciano
dluciano / NumberToWords.cs
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
{
@dluciano
dluciano / balanced.c
Created Jan 29, 2018
Verify balanced brackets, parenthesis and others.
View balanced.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#define IGNORE 0
#define OPEN 1
#define CLOSE 2
int isOpenChar(char c){
@dluciano
dluciano / index.html
Created Jul 27, 2017
Reverse polish notation algo
View index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>RPN</title>
<meta name="description" content="The HTML5 Herald">
<meta name="author" content="SitePoint">
@dluciano
dluciano / recipe_base2.cs
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; ){
@dluciano
dluciano / intToBit.cs
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++;
@dluciano
dluciano / palindromeR.py
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)
@dluciano
dluciano / palindrome.py
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
@dluciano
dluciano / palindrome.cs
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])
@dluciano
dluciano / sumOfN.py
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.