This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| export LC_ALL=en_US | |
| /opt/matlab//bin/matlab |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %! | |
| %% Example 6 | |
| /csquare { | |
| newpath | |
| 0 0 moveto | |
| 0 1 rlineto | |
| 1 0 rlineto | |
| 0 -1 rlineto | |
| closepath |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from graphics import * | |
| def sierpinskiT(points,level,win, label=0): | |
| colormap = ['blue','red','green','white'] #,'yellow','violet','orange'] | |