[Tut] How to make a paradox on your computer

Discussion in 'The Edge of the Forum' started by FireGrey, Mar 29, 2012.

  1. FireGrey
    OP

    FireGrey Undercover Admin

    Member
    3,920
    909
    Apr 13, 2010
    if variable = true {
    variable = false
    }
    if variable = false {
    variable = true
    }

    Try it, only a 20% chance of your computer exploding, or warping to another time.

    This is what has come of EOF posts... :ninja:
     
  2. prowler

    prowler Sony

    Member
    9,473
    2,816
    Jul 14, 2009
    Ragol
    1 star
     
    1 person likes this.
  3. Veho

    Veho The man who cried "Ni".

    Former Staff
    8,786
    16,359
    Apr 4, 2006
    Croatia
    Zagreb
    Does the "X = Y" line verify the truth of the statement, or assign the value Y to X? Either way, there's no paradox.
     
    1 person likes this.
  4. AlanJohn

    AlanJohn くたばれ

    Member
    3,453
    2,901
    Jan 6, 2011
    Canada,New Jersey
    Code:
    #include 
    int main()
    {if variable = true 
    variable = false
    }
    if variable = false }
    variable = true
    }  
     
  5. Veho

    Veho The man who cried "Ni".

    Former Staff
    8,786
    16,359
    Apr 4, 2006
    Croatia
    Zagreb
    That's still not a paradox.
     
  6. Jamstruth

    Jamstruth Secondary Feline Anthropomorph

    Member
    3,456
    183
    Apr 23, 2009
    North East Scotland
    You can create an infinite loop but not a paradox.
     
  7. Narayan

    Narayan desu~

    Member
    2,921
    825
    Sep 29, 2010
    still it'll only change true to false and false to true depending on the initial value.
    and iirc only that won't cause a loop.
     
  8. Veho

    Veho The man who cried "Ni".

    Former Staff
    8,786
    16,359
    Apr 4, 2006
    Croatia
    Zagreb
    It will either change the value of the variable several times regardless of the initial value, or do nothing. Depending on whether the "=" is equivalence or assigning value.
     
    1 person likes this.
  9. Narayan

    Narayan desu~

    Member
    2,921
    825
    Sep 29, 2010
    how will it
    :unsure: so it'll do nothing, since the initial value is null. it has to be either true or false first.
     
  10. FireGrey
    OP

    FireGrey Undercover Admin

    Member
    3,920
    909
    Apr 13, 2010
    How are you so sure I'm talking about just C++? :creep:
     
  11. sadak5

    sadak5 GBAtemp Fan

    Member
    421
    0
    Feb 27, 2007
    Mexico
    Mexico City
    The problem with that code is that it not compile, or is not C++
     
  12. Jamstruth

    Jamstruth Secondary Feline Anthropomorph

    Member
    3,456
    183
    Apr 23, 2009
    North East Scotland
    Generally "=" is an assigning value and a check would be something like "==" (this is what it is in Java)

    And yeah, this isn't an entire program, this is a code snippet and a poorly thought out joke. Should mention if you put any boolean through that code it comes out as true.
     
  13. AlanJohn

    AlanJohn くたばれ

    Member
    3,453
    2,901
    Jan 6, 2011
    Canada,New Jersey
    The the "}" are giving it away.
    Also: I was coding in C, not C++.
     
    1 person likes this.
  14. Ireland 1

    Ireland 1 GBAtemp Advanced Fan

    Member
    666
    6
    Sep 21, 2008
    Things like these are very annoying when someone puts it into your code, like the program.cs file. Its not fun, But its a lot funnier when you do it to someone else :)
    Code:
    While(2>1)
    {
    Messagebox.Show("Its not funny when it happens to you is it?");
    }
    
     
  15. Ammako

    Ammako GBAtemp Guru

    Member
    6,400
    3,530
    Dec 22, 2009
    Canada
    :hrth:
     
  16. Rydian

    Rydian Resident Furvert™

    Member
    27,883
    8,106
    Feb 4, 2010
    United States
    Cave Entrance, Watching Cyan Write Letters
    Code:
    
    
    The output is actually...
    Code:
    abcd
    abba
     
  17. Lilith Valentine

    Lilith Valentine GBATemp's Wolfdog™ Kneel before the Queen

    Member
    18,976
    18,931
    Sep 13, 2009
    Antarctica
    Between insane and insecure
    This didn't blowup my laptop, but I think it did fry my DS, true story.
     
  18. sadak5

    sadak5 GBAtemp Fan

    Member
    421
    0
    Feb 27, 2007
    Mexico
    Mexico City
    "==" to validate is an standard usend n both Java and all the C-Floavored languages, but in others it means comparison depending of the other keywords (for example if a==b in C is If a=b Then in Visual Basic).

    Once a friend did a program who tested the sound card in an old 486 PC using C, increasing 1db in each loop. After 5 minutes and the program hasn't finidhed, we had to cut the power or risk our ears to bleed.
     
  19. AlanJohn

    AlanJohn くたばれ

    Member
    3,453
    2,901
    Jan 6, 2011
    Canada,New Jersey
    WAIT WAIT, AFTER SPENDING MY TIME LEARNING C++11, O FINALLY UNDERSTOOD WHAT WAS WRONG!
    Code:
    #include 
    main()
    {
    int x
    int y
    printf("Input x here, you dumbfuck \n");
    scanf("%d", x);
    printf("You've entered %d! Now input y \n", x);
    scanf("%d", y);
    pritnf("You've entered %d! \n", y);
    if x > y {
    x == y
    }
    else {
    printf("IMPOSSIBLE \n");
    what I just typed was complete bullshit, and if you fell for it that means you're a complete retard that shouldn't live on this planet.
     
  20. Foxi4

    Foxi4 On the hunt...

    pip Reporter
    23,509
    21,434
    Sep 13, 2009
    Poland
    Gaming Grotto
    1. End your declarations with ;
    2. getch() would probably be useful here, no? ;)