neidu@feddit.nl to Asklemmy@lemmy.ml · 9 months agowhat is a skill you wish you had, and why?plus-squaremessage-squaremessage-square0fedilinkarrow-up10arrow-down10
arrow-up10arrow-down1message-squarewhat is a skill you wish you had, and why?plus-squareneidu@feddit.nl to Asklemmy@lemmy.ml · 9 months agomessage-square0fedilink
minus-squareneidu@feddit.nltoProgramming Horror@programming.dev•God I wish there was an easier way to do thislinkfedilinkarrow-up0·edit-29 months agoMy solution in perl back in the day when I was a teenage hobbyist who didn’t know about the modulus operator: Divide by 2 and use regex to check for a decimal point. if ($num / 2 =~ /\./) { return “odd” } else { return “even” } linkfedilink
minus-squareneidu@feddit.nltonorge@lemmy.world•dall-e 3 "Nordmann som unngår sosiale situasjoner"linkfedilinkEnglisharrow-up0·edit-210 months agoJeg velger i tillegg å tro at det som foregår utenfor er at naboen får overraskende besøk av en lynsjemobb linkfedilink
minus-squareneidu@feddit.nltonorge@lemmy.world•dall-e 3 "Nordmann som unngår sosiale situasjoner"linkfedilinkEnglisharrow-up0·10 months agoEr det der en bong helt til høyre på hylla? linkfedilink
My solution in perl back in the day when I was a teenage hobbyist who didn’t know about the modulus operator: Divide by 2 and use regex to check for a decimal point.
if ($num / 2 =~ /\./) { return “odd” }
else { return “even” }