Skip to content

Instantly share code, notes, and snippets.

View seyyah's full-sized avatar

seyyah seyyah

View GitHub Profile
#!/bin/sh
export LC_ALL=en_US
/opt/matlab//bin/matlab
class LogicGate:
def __init__(self,n):
self.label = n
self.output = None
def getLabel(self):
return self.label
def getOutput(self):
self.output = self.performGateLogic()
@seyyah
seyyah / hanoi
Created November 11, 2010 15:00
def print_hanoi(i,a, b, c):
print "Asama %s: " % (i)
a.show("\tSol :")
b.show("\tOrt :")
c.show("\tSag :")
i += 1
return i
def move(X, Y):
xp = X.peek()
@seyyah
seyyah / 6.ps
Created November 23, 2010 05:28
%!
%% Example 6
/csquare {
newpath
0 0 moveto
0 1 rlineto
1 0 rlineto
0 -1 rlineto
closepath
#include <stdio.h>
int main() {
char bar[] = "abc";
int zoo[] = {1,2,4,5,7,8};
printf("%d", sizeof(bar)/sizeof(bar[0]));
printf("%d", sizeof(zoo)/sizeof(zoo[0]));
return 0;
@seyyah
seyyah / mat.c
Created December 19, 2010 05:25
#include <stdio.h>
int main(void)
{
int amatrisi[2][2]={2,3,4,5};
int bmatrisi[2][2]={6,7,8,9};
int cmatrisi[2][2];
int x,y;
printf("a matrisi\n");
@seyyah
seyyah / mat.c
Created December 19, 2010 05:26
#include <stdio.h>
int main(void)
{
int amatrisi[2][2]={2,3,4,5};
int bmatrisi[2][2]={6,7,8,9};
int cmatrisi[2][2];
int x,y;
printf("a matrisi\n");
# graphics.py
"""Simple object oriented graphics library
The library is designed to make it very easy for novice programmers to
experiment with computer graphics in an object oriented fashion. It is
written by John Zelle for use with the book "Python Programming: An
Introduction to Computer Science" (Franklin, Beedle & Associates).
LICENSE: This is open-source software released under the terms of the
GPL (http://www.gnu.org/licenses/gpl.html).
from graphics import *
def main():
win = GraphWin("My Circle", 100, 100)
c = Circle(Point(50,50), 10)
c.draw(win)
win.getMouse() # Pause to view result
win.close() # Close window when done
main()
from graphics import *
def sierpinskiT(points,level,win, label=0):
colormap = ['blue','red','green','white'] #,'yellow','violet','orange']