Prime Numbers (A small web app)

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
User avatar
superLED
Chaos Rift Junior
Chaos Rift Junior
Posts: 303
Joined: Sun Nov 21, 2010 10:56 am
Current Project: Engine
Favorite Gaming Platforms: N64
Programming Language of Choice: C++, PHP
Location: Norway

Prime Numbers (A small web app)

Post by superLED »

I am making something for my gf that is studying to be a math teacher, and she asked me to make something, so she could enter a number and check it it is a prime number.
And to make it as 'universal' as possible, I wanna make it on the web.

We don't have a "Design Discussion", so i just put it here, since it's not near a game.
(Edit: Well, fuck me, we have an "Art, Music, and Design" section on the forum. But I am asking for help regards to features and functionality as well, so it can be fun and easy to use.)

Check it out: http://nechrology.com/prime/

I want feedback on the design and the functionality. Thanks a lot!

Stuff I know I wanna do:

- Do not reload the entire site when entering a number; I am going to refresh only the "Yes"/"No" image (Ajax).
- I am gong to add some "Fun Facts" about prime numbers, so people can read what it's all about.
- Make a title like "Is this a prime number?" on the top, so it's clear what this is actually about.
- Make a "Progress Bar" when it is calculating. If you type in a large number, it will take some seconds before the calculation is done.

This is only a simple project, and it serves as a single-purpose-page; it's only going to tell if a number is a prime number or not.
(Don't mind the currently fuck'd source code)
tappatekie
Chaos Rift Junior
Chaos Rift Junior
Posts: 204
Joined: Mon Nov 21, 2011 3:01 pm
Current Project: Web browser from scratch
Favorite Gaming Platforms: SNES, PSP, PS1 and 3
Programming Language of Choice: C#
Location: A house near me
Contact:

Re: Prime Numbers (A small web app)

Post by tappatekie »

Love the graphics :D
Feedback would be:
Maybe have some sort of no-input delay (like, when i stop typing on the text box after a few seconds, it calculates for me...) (not entirely sure this is possible ..)
User avatar
superLED
Chaos Rift Junior
Chaos Rift Junior
Posts: 303
Joined: Sun Nov 21, 2010 10:56 am
Current Project: Engine
Favorite Gaming Platforms: N64
Programming Language of Choice: C++, PHP
Location: Norway

Re: Prime Numbers (A small web app)

Post by superLED »

tappatekie wrote:Love the graphics :D
Feedback would be:
Maybe have some sort of no-input delay (like, when i stop typing on the text box after a few seconds, it calculates for me...) (not entirely sure this is possible ..)
Thanks a lot!
I don't quite understand why that would happen. It doesn't auto-calculate in my browser. Which browser are you using? Do you have any plug-ins that could make this happen?
tappatekie
Chaos Rift Junior
Chaos Rift Junior
Posts: 204
Joined: Mon Nov 21, 2011 3:01 pm
Current Project: Web browser from scratch
Favorite Gaming Platforms: SNES, PSP, PS1 and 3
Programming Language of Choice: C#
Location: A house near me
Contact:

Re: Prime Numbers (A small web app)

Post by tappatekie »

superLED wrote:
tappatekie wrote:Love the graphics :D
Feedback would be:
Maybe have some sort of no-input delay (like, when i stop typing on the text box after a few seconds, it calculates for me...) (not entirely sure this is possible ..)
Thanks a lot!
I don't quite understand why that would happen. It doesn't auto-calculate in my browser. Which browser are you using? Do you have any plug-ins that could make this happen?
I meant as a feature, but i'm using Google Chrome 14 with no addons...
User avatar
superLED
Chaos Rift Junior
Chaos Rift Junior
Posts: 303
Joined: Sun Nov 21, 2010 10:56 am
Current Project: Engine
Favorite Gaming Platforms: N64
Programming Language of Choice: C++, PHP
Location: Norway

Re: Prime Numbers (A small web app)

Post by superLED »

tappatekie wrote:
superLED wrote:
tappatekie wrote:Love the graphics :D
Feedback would be:
Maybe have some sort of no-input delay (like, when i stop typing on the text box after a few seconds, it calculates for me...) (not entirely sure this is possible ..)
Thanks a lot!
I don't quite understand why that would happen. It doesn't auto-calculate in my browser. Which browser are you using? Do you have any plug-ins that could make this happen?
I meant as a feature, but i'm using Google Chrome 14 with no addons...
Oh, haha, I misunderstood your post. I thought that it did that at this moment.

If I am going add that as a feature, it have to make you toggle it on yourself. If young student or a slow typer would type in a number, it may calculate it before he/she was able to type in the full number. And when you are done typing, the input-field must be cleared, so you can continue type in more numbers. So it would suck if you didn't typed it in fast enough, and it would reset.
Maybe I can make a toggle function, but I don't know if people would wait for 3 sec to pass instead of hitting the return button :P
tappatekie
Chaos Rift Junior
Chaos Rift Junior
Posts: 204
Joined: Mon Nov 21, 2011 3:01 pm
Current Project: Web browser from scratch
Favorite Gaming Platforms: SNES, PSP, PS1 and 3
Programming Language of Choice: C#
Location: A house near me
Contact:

Re: Prime Numbers (A small web app)

Post by tappatekie »

superLED wrote: If I am going add that as a feature, it have to make you toggle it on yourself. If young student or a slow typer would type in a number, it may calculate it before he/she was able to type in the full number. And when you are done typing, the input-field must be cleared, so you can continue type in more numbers. So it would suck if you didn't typed it in fast enough, and it would reset.
Maybe I can make a toggle function, but I don't know if people would wait for 3 sec to pass instead of hitting the return button :P
Makes sense :P
User avatar
Ginto8
ES Beta Backer
ES Beta Backer
Posts: 1064
Joined: Tue Jan 06, 2009 4:12 pm
Programming Language of Choice: C/C++, Java

Re: Prime Numbers (A small web app)

Post by Ginto8 »

It might be more interesting to also have a list of all primes. You could have it update as it scrolls by using the Sieve of Eratosthenes algorithm or something similar. I also think a lot of calculation here could be done client-side, since checking for prime-ness is not a terribly costly operation.

If the dynamic list seems too annoying you could also use the Sieve for a "list all primes below x" functionality.
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
User avatar
superLED
Chaos Rift Junior
Chaos Rift Junior
Posts: 303
Joined: Sun Nov 21, 2010 10:56 am
Current Project: Engine
Favorite Gaming Platforms: N64
Programming Language of Choice: C++, PHP
Location: Norway

Re: Prime Numbers (A small web app)

Post by superLED »

Ginto8 wrote:It might be more interesting to also have a list of all primes. You could have it update as it scrolls by using the Sieve of Eratosthenes algorithm or something similar. I also think a lot of calculation here could be done client-side, since checking for prime-ness is not a terribly costly operation.

If the dynamic list seems too annoying you could also use the Sieve for a "list all primes below x" functionality.
That is actually a pretty neat idea! Thanks a lot. I will see what I can manage to put together :)
Post Reply