A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 693
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

Re: aa - Stikked
From aa, 9 Years ago, written in Python.
This paste is a reply to aa from aa - view diff
Embed
  1. import pygame, random, sys, math
  2.  
  3. # You have to call this to make it work.
  4. pygame.init()
  5.  
  6. # Set up some variables containing the screeen size
  7. sizeX=600
  8. sizeY=600
  9.  
  10. # Set the starting colour
  11. colour = pygame.Color('#009900')
  12.  
  13. # Create the pygame window
  14. window = pygame.display.set_mode([sizeX,sizeY])
  15.  
  16. # Create the clock object
  17. clock = pygame.time.Clock()
  18.  
  19. # Put a name on the window.
  20. pygame.display.set_caption("Spirograph")
  21.  
  22. # Initialise more variables
  23. # k and l are numbers between 0 and 1.
  24. # k is the ratio of the distance of the small circle from the big circle
  25. l=random.random()
  26.  
  27. # l is the ratio of the small circles radius (to the hole with the pen in)
  28. # to the distance from the centre of the large circle.
  29. k=random.random()
  30.  
  31. # Counter - real number - not integer.
  32. i=0.0
  33.  
  34. # Scaling factor (Radius of big circle)
  35. R=300
  36.  
  37. x=0
  38. y=0
  39.  
  40. # This will loop forever.
  41. while True:
  42.     t = math.radians(i)
  43.  
  44.     newx = R * ((1-k) * math.cos(t) + l*k*math.cos((1-k) * t / k ))
  45.     newy = R * ((1-k) * math.sin(t) - l*k*math.sin((1-k) * t / k ))
  46.  
  47.     if (x==0 and y==0):
  48.        pass
  49.     else:
  50.        pygame.draw.line(window,colour,(x+R,y+R),(newx+R,newy+R),2)
  51.     x=newx
  52.     y=newy
  53.  
  54.     i=i+5
  55.  
  56.     clock.tick(40)
  57.     pygame.display.flip()
  58.     for event in pygame.event.get():
  59.         if event.type == pygame.QUIT:
  60.             sys.exit()
  61.         elif event.type == pygame.KEYDOWN:
  62.             if event.key == pygame.K_ESCAPE:
  63.                 sys.exit()
  64. sys.exit()