Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

Search the Community

Showing results for tags 'codefights'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • GENERAL
    • Introduce yourself
    • Discussions
    • Showcase
    • Need help?
    • Seeking team members?
    • Offtopic
  • RESOURCES
    • Example Projects
    • Scripts
    • Shaders
    • Unity Tutorials
    • FPS Kit Tutorials
    • 3D models
    • Animated 3D Models
    • Graphic design
    • Textures
    • Sounds
    • Other
  • SELL | REQUEST
    • Sell
    • Request
  • Mars' Modular Multiplayer Photon FPS Kit's Topics
  • Mars' Modular Multiplayer Photon FPS Kit's Reviews
  • Mars' Modular Multiplayer Photon FPS Kit's Updates
  • Mars' Modular Multiplayer Photon FPS Kit's Tutorials
  • Busy People's Introductions
  • Photon's Tutorials
  • Photon's Photon General
  • Photon's Showcase

Categories

  • Free Projects
  • Free Assets
  • Game Demos
  • Photon's Files

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


YouTube URL


Facebook URL


Twitter URL


IndieGoGo URL


Kickstarter URL


IndieDB URL


GreenLight URL


Location:


Interests

Found 1 result

  1. Hello, a bit over an hour ago, I signed up on codefights, and I got to a thing where you have to get the century from year. Which was pretty easy, and there's soo many ways to do it. Anyway, after I came up with a solution, I wanted to see how other people solved it, and the most interesting one I saw were return --year / 100 + 1 How does this work? I know -------------------------------- year = 1800 year / 100 + 1 = 19 expected = 18 -------------------------------- year = 1801 year / 100 + 1 = 19 expected = 19 -------------------------------- but if I add the -- before year, then it will output -------------------------------- year = 1800 --year / 100 + 1 = 18 expected = 18 -------------------------------- year = 1824 --year / 100 + 1 = 19 expected = 19 -------------------------------- How come after -- has been added before year, it all gets decremented kind of like, if year % 100 == 0 then decrement year / 100 + 1. Am I completely off? This just confuses me a bit, and it just makes me nuts, not knowing how it works Please help me to make me understand this, would really appreciate it I have seen it in for loops too(Not often though, only seen it being used in for loops 2 times), like so for(int i = 5; i > 0; --i) { // Blah blah } I have seen it with ++i too
×
×
  • Create New...