1. Список говнокодов пользователя dageru

    Всего: 2

  2. Си / Говнокод #3387

    +141

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    for (int x=0; x < TANK_SIZE; x++)
    
    	{
    
    		for (int y=0; y < TANK_SIZE; y++)
    
    		{
    
    			*((Uint32 *)(((Uint8 *)player_surface[DOWN]->pixels) + (TANK_SIZE - y - 1) * player_surface[DOWN]->pitch + (TANK_SIZE - x - 1) * player_surface[DOWN]->format->BytesPerPixel)) = *((Uint32 *)(((Uint8 *)player_surface[LEFT]->pixels) + (TANK_SIZE - x - 1) * player_surface[LEFT]->pitch + y * player_surface[LEFT]->format->BytesPerPixel)) = *((Uint32 *)(((Uint8 *)player_surface[RIGHT]->pixels) + x * player_surface[RIGHT]->pitch + (TANK_SIZE - y - 1) * player_surface[RIGHT]->format->BytesPerPixel)) = *((Uint32 *)(((Uint8 *)player_surface[UP]->pixels) + y * player_surface[UP]->pitch + x * player_surface[UP]->format->BytesPerPixel));
    
    			*((Uint32 *)(((Uint8 *)enemy_surface[DOWN]->pixels) + (TANK_SIZE - y - 1) * enemy_surface[DOWN]->pitch + (TANK_SIZE - x - 1) * enemy_surface[DOWN]->format->BytesPerPixel)) = *((Uint32 *)(((Uint8 *)enemy_surface[LEFT]->pixels) + (TANK_SIZE - x - 1) * enemy_surface[LEFT]->pitch + y * enemy_surface[LEFT]->format->BytesPerPixel)) = *((Uint32 *)(((Uint8 *)enemy_surface[RIGHT]->pixels) + x * enemy_surface[RIGHT]->pitch + (TANK_SIZE - y - 1) * enemy_surface[RIGHT]->format->BytesPerPixel)) = *((Uint32 *)(((Uint8 *)enemy_surface[UP]->pixels) + y * enemy_surface[UP]->pitch + x * enemy_surface[UP]->format->BytesPerPixel));
    
    			
    
    		}
    
    	}

    dageru, 03 Июня 2010

    Комментарии (5)
  3. Python / Говнокод #3335

    −115

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    import xml.parsers.expat
    
    text = 'lol'
    booltext = 'false'
    
    subs_temp = open('subs_temp.txt','w')
    
    def start_element(name, attrs):
    	if (name == 'rectRegion' and attrs['h']=='7.222' and attrs['y']=='92.778'):
    		subs_temp.write(attrs['t'] + '\n')
    		global text
    		subs_temp.write(text + '\n')
    	elif (name == 'TEXT'):
    		global booltext
    		booltext = 'true'
    		
    	#subs.write(name+'\n')
    	#print(attrs)
    
    def char_data(data):
    	global text
    	global booltext
    	if (booltext == 'true'):
    		text = data
    		booltext = 'false'
    
    p = xml.parsers.expat.ParserCreate("UTF-8")
    
    p.StartElementHandler = start_element
    p.CharacterDataHandler = char_data
    
    p.ParseFile(open("yt.xml", 'rb'))
    
    subs_temp.close()
    
    subs_temp = open('subs_temp.txt','r')
    subs = open('subs.txt','w')
    
    num = 1
    
    while num <= 44:
    	time1 = subs_temp.readline()
    	text = subs_temp.readline()
    	time2 = subs_temp.readline()
    	text = subs_temp.readline()
    
    	subs.write(str(num))
    	subs.write('\n0')
    	subs.write(time1[:-1])
    	subs.write('00 --> ')
    	subs.write(time2[:-1])
    	subs.write('00\n')
    	subs.write(text)
    	subs.write('\n')
    	
    	num+=1

    Нус, зацените мой первый опыт с питоном. Говнецо редкое, жаль просто так смывать. Так что пусть полежит здесь.

    dageru, 27 Мая 2010

    Комментарии (29)