Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Nicolas Figueroa nicolasfig

🎯
Focusing
Block or report user

Report or block nicolasfig

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
View pascalArray.java
package recursion;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
public class Recursion {
public static void pascalArray(int[][] matrix) {
@nicolasfig
nicolasfig / HelloPygame.py
Created Oct 17, 2012
Hello world and drawing some shapes using pygame
View HelloPygame.py
import pygame, sys
from pygame.locals import *
#Set up pygame
pygame.init()
#Set up the window
windowSurface = pygame.display.set_mode((500, 400), 0 , 32)
pygame.display.set_caption('Hello World')
@nicolasfig
nicolasfig / hangman.py
Created Oct 17, 2012
Hangman game using random and indexing
View hangman.py
import random
HANGMANPICS = ['''
+---+
| |
|
|
|
|
=========''','''
@nicolasfig
nicolasfig / guessMyNumber.py
Created Oct 16, 2012
Guess my number simple text game
View guessMyNumber.py
import random
guessesTaken = 0
print("Hello what is your name?")
name = input()
number = random.randint(1,20)
print("Well",name,",I am thinking of a number between 1 and 20.")
@nicolasfig
nicolasfig / beca.py
Created Oct 10, 2012
Patron singleton by Rafa.
View beca.py
class BecaEstudiante:
beca= None
cont= 0
@classmethod
def getBeca(cls,nombreBecado):
if cls.cont<5:
cls.cont+=1
cls.beca= BecaEstudiante()
@nicolasfig
nicolasfig / claseMatriz.py
Created Oct 9, 2012
python: Programa de matrices para pygroup
View claseMatriz.py
"""
Realizado por:
Rafael Baron Castro Cod: 20102020012
Nicolas Figueroa Beltran Cod: 20102020032
"""
class Matriz:
#constructor y atributos de la clase Matriz
def __init__(self, filas, columnas):
self.matriz=[]
@nicolasfig
nicolasfig / MatrixOp.py
Created Oct 7, 2012
python: Matrix operations using objecs "poorly structured"
View MatrixOp.py
#-------------------------------------------------------------------------------
# Name: Matrix
# Purpose:
#
# Author: Nicolas Figueroa
#
# Created: 06/10/2012
# Copyright: (c) Nicolas Figueroa 2012
#-------------------------------------------------------------------------------
import random
View ClaseMatrices.py
class Matriz:
def __init__(self, columnas, filas):
self.filas= filas
self.columnas= columnas
print("filas: ",filas,"columnas: ",columnas)
def llenarMattriz(self, filas, columnas):
@nicolasfig
nicolasfig / matrices.py
Created Oct 6, 2012
python: This file contains several matrix operations
View matrices.py
#-------------------------------------------------------------------------------
# Name: Matrix
# Purpose:
#
# Author: Nicolas Figueroa
#
# Created: 06/10/2012
# Copyright: (c) Nicolas Figueroa 2012
#-------------------------------------------------------------------------------
import random
@nicolasfig
nicolasfig / euler.java
Created Oct 5, 2012
java: Calcula el numero euler basado en el factorial
View euler.java
public class Euler {
public static long fact(int x) {
long prod = 1;
for (int i = 1; i < x; i++) {
prod = prod * i;
}
return prod;
}
public static double euler(){
You can’t perform that action at this time.