This file contains 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
import pygame, math, sys | |
def draw(dot1,dot2,dot3,order): | |
pygame.draw.lines(screen, (255,0,0), True, [dot1,dot2,dot3], 1) | |
if order>0: | |
newDot1 = (int((dot1[0]+dot2[0])*0.5),int((dot1[1]+dot2[1])*0.5)) | |
newDot2 = (int((dot2[0]+dot3[0])*0.5),int((dot2[1]+dot3[1])*0.5)) | |
newDot3 = (int((dot3[0]+dot1[0])*0.5),int((dot3[1]+dot1[1])*0.5)) | |
pygame.draw.lines(screen, (255,0,0), True, [newDot1,newDot2,newDot3], 1) |
This file contains 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
%option noyywrap | |
%{ | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
%} | |
%% | |
int nums[100],i=0; | |
[\-0-9]*|[0-9]* { | |
i++; |
This file contains 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
program matrix; | |
uses | |
graph, | |
SysUtils; | |
const | |
colnum = 15; | |
var | |
GrDriver, GrMode, GrError: smallint; |
This file contains 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
import pygame, pygame.font | |
import random | |
def IsWritten(): | |
defTemp = True | |
for x in xrange((lettersOnScreen[0] / 2) - (len(str) / 2), (lettersOnScreen[0] / 2) + (len(str) / 2) + 1): | |
if xHeads[x] == -1: | |
defTemp = False | |
return defTemp |
This file contains 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
program rucksack; | |
uses math; | |
type THistory = array [0..10000,0..10000] of integer; | |
tItem= record | |
val,size:integer; | |
end; | |
TItems = array [1..10000] of tItem; | |
var fin,fout: text; | |
maxSize,maxItems,curSize,counter,counter2:integer; | |
History:THIstory; |
This file contains 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
__author__ = 'mk070_000' | |
#R KEY - INCREASE FUNCTION LOOPS OR ACCURACY | |
#LEFT MOUSE, HOLD, MOVE, RELEASE - CHOOSE FUNCTION MERITS (max values, can be use to zoom in) | |
#RIGHT MOUSE - CREATE A JULIA SET , USING THE MOUSE COORDINATES | |
import math, pygame, cmath, sys | |
from pygame import gfxdraw | |
def mandelbrot(point ,koeff , n): | |
if abs(point) > 5: | |
return 254-(254.0/accuracy)*n |
This file contains 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
import pygame, math | |
pygame.init() | |
windowsSurfaceObj = pygame.display.set_mode((750,300)) | |
fpsClock = pygame.time.Clock() | |
whiteColor = (255,255,255) | |
greenColor = (0,255,0) | |
blackColor = (0,0,0) |
This file contains 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
import pygame | |
import numpy as np | |
# change these values | |
points = 10000 | |
circles = 30.0 | |
radius = 200.0 | |
resolution = np.array([1000, 500]) |
This file contains 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
import pygame | |
import numpy as np | |
# change these values | |
points_temp = 1000 | |
radius1 = 100 | |
radius2 = 100 | |
angular_speed_1 = 0.01 | |
angular_speed_2 = 0.0002 |
This file contains 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
import pygame | |
import numpy as np | |
# change these values | |
points = 50000 | |
radius1 = 100.0 | |
radius2 = 70.0 | |
point_disp = 100.0 | |
angle_ratio =radius1/radius2 |
OlderNewer