[Tut] How to make a paradox on your computer

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

Mar 29, 2012
  1. FireGrey
    OP

    Member FireGrey Undercover Admin

    Joined:
    Apr 13, 2010
    Messages:
    3,916
    Country:
    Australia
    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

    Member prowler Sony

    Joined:
    Jul 14, 2009
    Messages:
    9,473
    Location:
    Ragol
    Country:
    United Kingdom
    1 star
     
    1 person likes this.
  3. Veho

    Global Moderator Veho The man who cried "Ni".

    Joined:
    Apr 4, 2006
    Messages:
    8,447
    Location:
    Zagreb
    Country:
    Croatia
    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

    Member AlanJohn くたばれ

    Joined:
    Jan 6, 2011
    Messages:
    3,425
    Location:
    Canada,New Jersey
    Country:
    Ukraine
    Code:
    #include 
    int main()
    {if variable = true 
    variable = false
    }
    if variable = false }
    variable = true
    }  
     
  5. Veho

    Global Moderator Veho The man who cried "Ni".

    Joined:
    Apr 4, 2006
    Messages:
    8,447
    Location:
    Zagreb
    Country:
    Croatia
    That's still not a paradox.
     
  6. Jamstruth

    Member Jamstruth Secondary Feline Anthropomorph

    Joined:
    Apr 23, 2009
    Messages:
    3,456
    Location:
    North East Scotland
    Country:
    United Kingdom
    You can create an infinite loop but not a paradox.
     
  7. Narayan

    Member Narayan desu~

    Joined:
    Sep 29, 2010
    Messages:
    2,921
    Country:
    Philippines
    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

    Global Moderator Veho The man who cried "Ni".

    Joined:
    Apr 4, 2006
    Messages:
    8,447
    Location:
    Zagreb
    Country:
    Croatia
    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

    Member Narayan desu~

    Joined:
    Sep 29, 2010
    Messages:
    2,921
    Country:
    Philippines
    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

    Member FireGrey Undercover Admin

    Joined:
    Apr 13, 2010
    Messages:
    3,916
    Country:
    Australia
    How are you so sure I'm talking about just C++? :creep:
     
  11. sadak5

    Member sadak5 GBAtemp Fan

    Joined:
    Feb 27, 2007
    Messages:
    421
    Location:
    Mexico City
    Country:
    Mexico
    The problem with that code is that it not compile, or is not C++
     
  12. Jamstruth

    Member Jamstruth Secondary Feline Anthropomorph

    Joined:
    Apr 23, 2009
    Messages:
    3,456
    Location:
    North East Scotland
    Country:
    United Kingdom
    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

    Member AlanJohn くたばれ

    Joined:
    Jan 6, 2011
    Messages:
    3,425
    Location:
    Canada,New Jersey
    Country:
    Ukraine
    The the "}" are giving it away.
    Also: I was coding in C, not C++.
     
    1 person likes this.
  14. Ireland 1

    Member Ireland 1 GBAtemps resident Irish

    Joined:
    Sep 21, 2008
    Messages:
    666
    Location:
    Ireland
    Country:
    Ireland
    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

    Member Ammako GBAtemp Guru

    Joined:
    Dec 22, 2009
    Messages:
    6,372
    Country:
    Canada
    :hrth:
     
  16. Rydian

    Member Rydian Resident Furvert™

    Joined:
    Feb 4, 2010
    Messages:
    27,883
    Location:
    Cave Entrance, Watching Cyan Write Letters
    Country:
    United States
    Code:
    
    
    The output is actually...
    Code:
    abcd
    abba
     
  17. Crystal the Glaceon

    Member Crystal the Glaceon GBAtemp Inkling™ Squishies~

    Joined:
    Sep 13, 2009
    Messages:
    14,729
    Location:
    Inkopolis
    Country:
    Antarctica
    This didn't blowup my laptop, but I think it did fry my DS, true story.
     
  18. sadak5

    Member sadak5 GBAtemp Fan

    Joined:
    Feb 27, 2007
    Messages:
    421
    Location:
    Mexico City
    Country:
    Mexico
    "==" 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

    Member AlanJohn くたばれ

    Joined:
    Jan 6, 2011
    Messages:
    3,425
    Location:
    Canada,New Jersey
    Country:
    Ukraine
    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

    Reporter Foxi4 On the hunt...

    pip
    Joined:
    Sep 13, 2009
    Messages:
    22,712
    Location:
    Gaming Grotto
    Country:
    Poland
    1. End your declarations with ;
    2. getch() would probably be useful here, no? ;)
     

Share This Page