Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualNet Gnome

Posted 01 August 2013 - 01:29 PM

i guess you could get crafty and make this work:

x+=vk==vkl?5:vk==vkr?-5:0;y+=vk==vku?-5:vk==vkd?5:0;

destroys all readability though ;)

 

[realized i could compress it a bit more ;)]

 

if your compiler allows logical and-ing ints: you can shorten it to this:

x+=vk&vkl?-5:vk&vkr?5:0;y+=vk&vku?-5:vk&vkd?5:0;

#7Net Gnome

Posted 01 August 2013 - 12:50 PM

i guess you could get crafty and make this work:

x+=vk==vkl?5:vk==vkr?-5:0;y+=vk==vku?-5:vk==vkd?5:0;

destroys all readability though ;)

 

[realized i could compress it a bit more ;)]


#6Net Gnome

Posted 01 August 2013 - 12:46 PM

i guess you could get crafty and make this work:

x += vk == vkl ? 5:vk == vkr ? -5:0;y += vk == vku ? -5:vk == vkd ? 5:0;

destroys all readability though ;)


#5Net Gnome

Posted 01 August 2013 - 12:45 PM

i guess you could get crafty and make this work:

x += vk == vkl ? 5 : vk == vkr ? -5 : 0; y += vk == vku ? -5 : vk == vkd ? 5 : 0;

destroys all readability though ;)


#4Net Gnome

Posted 01 August 2013 - 12:42 PM

i guess you could get crafty and make this work:

x = vk == vkl ? -5 : 5; y = vk == vku ? -5 : 5;

destroys all readability though ;)


#3Net Gnome

Posted 01 August 2013 - 12:42 PM

i guess you could get crafty and make this work:

x = vk == vkl ? 5 : -5; y = vk == vku ? -5 : 5;

destroys all readability though ;)


PARTNERS