Flash Website Builder- Trendy Site Builder is a Flash Site Building tool that helps users build stunning websites. Check Out Custom Custom Logo Design by LogoBee. Website Design and Free Logo Templates available.
 CodingForums.com Basic maths game help, division.
 User Name Remember Me? Password

Before you post, read our: Rules & Posting Guidelines

Enjoy an ad free experience by logging in. Not a member yet? Register.
 03-06-2013, 01:43 AM PM User | #1 dreamscape92 New to the CF scene   Join Date: Mar 2013 Posts: 2 Thanks: 0 Thanked 0 Times in 0 Posts Basic maths game help, division. Hi all, Just recently started programming so apologies if this is noobish. I am making a basic maths game for a project and are just having a few problems with it. I have four questions, multiply, add, division and minus and all the numbers are randomly generated. However I am trying to get my head round how I could make the division numbers only even, or numbers that won't leave decimals remaining in the answer, 10 divided by 7 = 1.428 etc. This is my code for the division problem. Divide one and divide 2 are the two separate numbers that will appear to be divided. I've made it so the first number is always larger than the first one, but now are trying to avoid these awkward numbers that cause remainders. // Fill in the division problem. divide1 = randomizer.Next(5, 11); divide2 = randomizer.Next(2, 4); DivLLabel.Text = divide1.ToString(); DivRLabel.Text = divide2.ToString(); sum3.Value = 0; Thanks in advance.
 03-06-2013, 01:58 AM PM User | #2 felgall Master Coder     Join Date: Sep 2005 Location: Sydney, Australia Posts: 6,099 Thanks: 0 Thanked 579 Times in 569 Posts Simplest solution: Generate two random numbers. The first number for the divide will be the two random numbers multiplied together, the second number for the divide will be one of the random numbers - so the answer will be the other random number. __________________ Stephen Learn Modern JavaScript - http://javascriptexample.net/ Helping others to solve their computer problem at http://www.felgall.com/ Beginners need to advise whether they want to learn "Latin" JavaScript for Netscape 3 or "Italian" JavaScript for modern browsers.
 03-06-2013, 02:20 AM PM User | #3 dreamscape92 New to the CF scene   Join Date: Mar 2013 Posts: 2 Thanks: 0 Thanked 0 Times in 0 Posts Great thanks! Appreciate it.

 Bookmarks

 Tags basic, maths

 Thread Tools Rate This Thread Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home :: Client side development     JavaScript programming         DOM and JSON scripting         Ajax and Design         JavaScript frameworks         Post a JavaScript     HTML & CSS     XML     Flash & ActionScript         Adobe Flex     Graphics and Multimedia discussions     General web building         Site reviews         Building for mobile devices :: Server side development     Apache configuration     Perl/ CGI     PHP         Post a PHP snippet     MySQL         Other Databases     Ruby & Ruby On Rails     ASP     ASP.NET     Java and JSP     Other server side languages/ issues         ColdFusion         Python :: Computing & Sciences     Computer Programming     Computer/PC discussions     Geek News and Humour Web Projects and Services Marketplace     Web Projects         Small projects (quick fixes and changes)         Medium projects (new script, new features, etc)         Large Projects (new web application, complex features etc)         Unknown sized projects (request quote)         Vacant job positions         Looking for work/ for hire         Project collaboration/ partnership         Paid work offers and requests (Now CLOSED)     Career, job, and business ideas or advice     Domains, Sites, and Designs for sale         Domains for sale         Websites for sale         Design templates and graphics for sale :: Other forums     Member Offers     Forum feedback and announcements

All times are GMT +1. The time now is 09:14 AM.