Си диез / Говнокод #25795 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  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
class Label : System.Windows.Forms.Label {
        public Label ( string s , int x , int y , Form parent ) {
            this.Location = new Point ( x , y ) ;
            this.Text = s ;
            this.AutoSize = true ;
            this.Font = new Font ( SystemFonts.CaptionFont , FontStyle.Bold ) ;
            parent.Controls.Add ( this ) ;
        }
    }
    class Button : System.Windows.Forms.Button {
        public Button ( string s , int x , int y ,  EventHandler f , Form parent ) {
            this.Location = new Point ( x , y ) ;
            this.Text = s ;
            this.Font = new Font ( SystemFonts.CaptionFont , FontStyle.Bold ) ;
            this.Click += f ;
            parent.Controls.Add ( this ) ;
        }
    }

    static Form form = new Form() ;
    static Button[,] a = new Button [ 4 , 4 ] ;
    static Random rnd = new Random() ;
    static Timer timer = new Timer() ;
    static Label time = new Label ( "0" , width + cellspacing * 3 , 4 * ( width + cellspacing ) + cellspacing * 2 , form ) ;
    static Label nclicks = new Label ( "0" , 3 * width + cellspacing * 5 , 4 * ( width + cellspacing ) + cellspacing * 2 , form ) ;

Нашел архив своего старого говна :)

Запостил: Pretty_Young_Thing Pretty_Young_Thing, (Updated )

Комментарии (11) RSS

  • Странный ты петух. Не в Visual Studio песал чтоли?
    Ответить
  • Перевёл:
    <?php
    class Label extends System\Windows\Forms\Label {
        public function Label ($s , $x , $y , $parent ) {
                $this->Location = new Point ( $x , $y ) ;
                $this->Text = $s ;
                $this->AutoSize = true ;
                $this->Font = new Font ( SystemFonts::CaptionFont , FontStyle::Bold ) ;
                $parent->Controls->Add ( $this ) ;
        }
    }
    
    class Button extends System\Windows\Forms\Button {
        public function Button ( $s , $x , $y ,  $f , $parent ) {
                $this->Location = new Point ( $x , $y ) ;
                $this->Text = $s ;
                $this->Font = new Font ( SystemFonts::CaptionFont , FontStyle::Bold ) ;
                $this->Click += $f ;
                $parent->Controls->Add ( $this ) ;
        }
    }
    
    $form = new Form() ;
    $a = new Button ([ 4 , 4 ]) ;
    $rnd = new Random() ;
    $timer = new Timer() ;
    $time = new Label ( '0' , $width + $cellspacing * 3 , 4 * ( $width + $cellspacing ) + $cellspacing * 2 , $form ) ;
    $nclicks = new Label ( '0' , 3 * $width + $cellspacing * 5 , 4 * ( $width + $cellspacing ) + $cellspacing * 2 , $form ) ;
    Ответить
    • Хе-хе, анскилльный "PHP" разрешает инициализацию свойств только константными выражениями.

      Кстати:
      $a = []
      Именно поэтому я за "PHP".
      Ответить

Добавить комментарий

Помни, guest, за тобой могут следить!

    А не использовать ли нам bbcode?


    8