Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@JS96
This is how they should have done it
<code>
Int numbers;
Int percent;
while(percent < 101)
{
If(percent == 15) \\ to example
{
\\ do the stuff you want
}
If(percent == 70) \\ to example
{
\\ do the stuff you want
}
// Add to percentage and numbers
percent = percent + 1;
numbers = numbers + 1;
// Change the text on the app
percentage.text = percent;
stuffdone.text = numbers + " /
510";
}
</code> -
JS96184557y@HampusMa it's probably something more similar to this:
for (int i = 0; i < IPs->count; i++) {
// Scan IP
String IP = IPs[i];
// Do stuff
percent = round((i+1) / IPs->count) * 100);
percentage.text = percent;
stuffdone.text = (i+1) + " / " IPS->count;
}
But probably someone used "ceil()" instead of "round()", which returns the bigger integer ignoring the decimals (99.4 -> 100, 99.8 -> 100). -
Rohr7307yI would say net-, broadcast- and your own address are maybe not worth to be counted ...
Net and broadcast should not be in use.
As you are doing things, you are online...
So, seems ok for me. -
Skayo85687y
-
@Skayo yeah.
I did while percent is less than 101.
That means, when it goes to 100 it stops because if it goes to 101 it is equal to 101 not less than -
neodite6147y@HampusMa I think you still have some learning to do lol.
His code is the same as
If percent is less than 100
AND (notice the and)
If percent equals 100. -
neodite6147y@HampusMa no, we are talking about when @Skayo said you should be using
<= 100
Instead of your < 101
And you seem to not understand his does the same thing. -
@neodite i didn't know we where talking about his. If i knew that then l would understand.
Related Rants
-
linuxxx32*client calls in* Me: good morning, how can I help you? Client: my ip is blocked, could you unblock it for m...
-
DRSDavidSoft28Found this in our codebase, apparently one of my co-workers had written this
-
linuxxx23*client calls* "hello, we forgot the password to our WiFi router. Could you reset that for us?" 😐😶😮...
This does not make any sense!
rant
makes no sense
wtf