The world is currently online!


Welcome to Emps-World!

Register now to gain access to all of our forum features. Once registered and logged in, you will be able to create topics, post replies, send private messages, manage your profile, chat with other players in the shoutbox and much more. Once you sign in, this message will disappear.



Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Bluestorm

Pages: 1 ... 10 11 12 13 14 15 16 17 18 19 20 ... 23
211
Computers and Technology / Re: C code.
« on: April 08, 2017, 08:26:47 pm »
Use this function to check if a number is prime or not:

int is_prime(int num)
{
     if (num <= 1) return 0;
     if (num % 2 == 0 && num > 2) return 0;
     for(int i = 3; i < num / 2; i+= 2)
     {
         if (num % i == 0)
             return 0;
     }
     return 1;
}

If you looking for faster code use sqrt(num) instead of num/2 in the loop.

Forgot to mention however in this assignment I am not allowed to use anything other than int main ()
:/

it would've been super easy with functions tho ;P

Thanks, adam.

Well you can use the loop in this function in the main() ;)

212
Computers and Technology / Re: C code.
« on: April 08, 2017, 06:49:56 pm »
Use this function to check if a number is prime or not:

int is_prime(int num)
{
     if (num <= 1) return 0;
     if (num % 2 == 0 && num > 2) return 0;
     for(int i = 3; i < num / 2; i+= 2)
     {
         if (num % i == 0)
             return 0;
     }
     return 1;
}

If you looking for faster code use sqrt(num) instead of num/2 in the loop.

213
Suggestions & Ideas / Re: Big slayer expansion update
« on: April 07, 2017, 06:52:34 pm »
Otto the savior.

214
Goals & Achievements / Re: I wonder what skill it is
« on: April 05, 2017, 05:27:32 pm »
Congratulations, you really love darkness.

215
Off-Topic / Re: Karel appreciation thread
« on: April 03, 2017, 08:29:54 pm »

216
Screenshots / Re: iamverysmartironman
« on: April 02, 2017, 04:15:17 pm »
Our new super hero 'Starman'

217
Help me! / Re: How to get quest items back if lost?
« on: March 27, 2017, 05:09:22 pm »
I think yes, go to port sarim there's a dungeon with fairies talk to the first fairy you see.

218
Off-Topic / Re: Happy birthday Gabe
« on: March 25, 2017, 04:16:21 pm »
happy birthday

219
Off-Topic / Re: Lets count to 10,000
« on: March 23, 2017, 02:29:27 pm »
2277

220
Off-Topic / Re: Lets count to 10,000
« on: March 23, 2017, 01:57:48 pm »
2275

221
Off-Topic / Re: Karel appreciation thread
« on: March 19, 2017, 09:09:08 pm »

222
Off-Topic / Re: Lets count to 10,000
« on: March 19, 2017, 07:54:11 pm »
2273

223
Update Notes / Re: Updates March 16th 2017 - Graphical Improvements
« on: March 17, 2017, 08:35:33 pm »
This new fog is awesome,  thanks for clues ^.^

224
Off-Topic / Re: Lets count to 10,000
« on: March 16, 2017, 08:16:55 pm »
2271

225
Off-Topic / Re: Karel appreciation thread
« on: March 15, 2017, 06:13:06 pm »

Pages: 1 ... 10 11 12 13 14 15 16 17 18 19 20 ... 23