Search Results

Search found 13 results on 1 pages for 'randnum'.

Page 1/1 | 1 

  • Dual Boot Installing Ubuntu 12.04 with Windows 7 (64) on a non UEFI system

    - by Randnum
    I cannot seem to install the correct boot loader for a non-UEFI firmware system. I'm trying to install Ubuntu 12.04 and Windows 7 (64) which are technically compatible with GPT but for windows only if the firmware is UEFI enabled. My system uses the old BIOS system and does not support UEFI. Therefore, whenever I finish my Ubuntu install and try to install Windows I get a "cannot install to GPT partition type" error. Even if I use Gparted to format a special NTFS file format for windows it can't handle the GPT partition style because it doesn't have UEFI. But my ubuntu install always forces GPT during installation and never asks if I want to install the old BIOS style MBR instead. How do I resolve this? Both OS's will install fine on their own the problem is when I try to install the second OS it doesn't recognize any of the other's partitions and tries to rewrite it's own on top of the other. I've tried both OS's first and always run into the same problem. Since there is no way to make Windows recognize GPT without upgrading my Motherboard how do I tell Ubuntu to use the old BIOS MBR on install? Do I have to download a special Ubuntu with a specific grub version? or should I manaually configure my partition somehow to force it not to use GPT? Thank you,

    Read the article

  • Installing ubuntu 12.04, installs but does not boot after it asks me to remove the CD

    - by Randnum
    I'm Trying to install Ubuntu 12.04 on my computer. It had an old copy of Windows 7 on it I tried to reformat the hard drive for a fresh install of Ubuntu but I think I messed up the partitions in some way that prevents it from fully loading. I'm able to complete the install fine and use guided partitioning so it should be happy but when it gets about 90% through at the part that ejects the cd and restarts the system it fails. After ejecting the CD and restarting it just loads up the bios lenovo splash screen then purple then black. I can hear a sound from my speakers like some notification sound but there is no text on my screen. I've since gone back in under Rescue System to try and reconfigure the partitions hoping that it will fix it and i've tried several combinations. Currently it's SCST1 (0,0,0) (sda) - 500.1 GB ATA WDC WD5000AAkKX-0 #1 100.0 MB K biosgrub #2 494.1 GB B K ext4 / #3 5.9 GB F swap swap 8.2 kb FREE SPACE I'm not sure if I need to set the ext4 to contain the boot flag but if I don't include at least one partition with the boot flag enabled it complains saying that "The partition table format in use on your disks normally requires you to create a separate partition for boot loader code. This partitionshould be marked for use as an "EFI boot Partition" and should be at least 35 MB in size. Note that this is not hte same as a partition mounted on /boot" Like I said it seems to have installed all of the actual data from the CD it's just not properly booting for some reason

    Read the article

  • Dual Boot Installing Ubuntu 12.04 with Windows 7 (64) on a non UEFI system fails

    - by Randnum
    I cannot seem to install the correct boot loader for a non-UEFI firmware system. I'm trying to install Ubuntu 12.04 and Windows 7 (64) which are technically compatible with GPT but for windows only if the firmware is UEFI enabled. My system uses the old BIOS system and does not support UEFI. Therefore, whenever I finish my Ubuntu install and try to install Windows I get a "cannot install to GPT partition type" error. Even if I use Gparted to format a special NTFS file format for windows it can't handle the GPT partition style because it doesn't have UEFI. But my ubuntu install always forces GPT during installation and never asks if I want to install the old BIOS style MBR instead. How do I resolve this? Both OS's will install fine on their own the problem is when I try to install the second OS it doesn't recognize any of the other's partitions and tries to rewrite it's own on top of the other. I've tried both OS's first and always run into the same problem. Since there is no way to make Windows recognize GPT without upgrading my Motherboard how do I tell Ubuntu to use the old BIOS MBR on install? Do I have to download a special Ubuntu with a specific grub version? or should I manaually configure my partition somehow to force it not to use GPT? Thank you,

    Read the article

  • Need help with fixing Genetic Algorithm that's not evolving correctly

    - by EnderMB
    I am working on a maze solving application that uses a Genetic Algorithm to evolve a set of genes (within Individuals) to evolve a Population of Individuals that power an Agent through a maze. The majority of the code used appears to be working fine but when the code runs it's not selecting the best Individual's to be in the new Population correctly. When I run the application it outputs the following: Total Fitness: 380.0 - Best Fitness: 11.0 Total Fitness: 406.0 - Best Fitness: 15.0 Total Fitness: 344.0 - Best Fitness: 12.0 Total Fitness: 373.0 - Best Fitness: 11.0 Total Fitness: 415.0 - Best Fitness: 12.0 Total Fitness: 359.0 - Best Fitness: 11.0 Total Fitness: 436.0 - Best Fitness: 13.0 Total Fitness: 390.0 - Best Fitness: 12.0 Total Fitness: 379.0 - Best Fitness: 15.0 Total Fitness: 370.0 - Best Fitness: 11.0 Total Fitness: 361.0 - Best Fitness: 11.0 Total Fitness: 413.0 - Best Fitness: 16.0 As you can clearly see the fitnesses are not improving and neither are the best fitnesses. The main code responsible for this problem is here, and I believe the problem to be within the main method, most likely where the selection methods are called: package GeneticAlgorithm; import GeneticAlgorithm.Individual.Action; import Robot.Robot.Direction; import Maze.Maze; import Robot.Robot; import java.util.ArrayList; import java.util.Random; public class RunGA { protected static ArrayList tmp1, tmp2 = new ArrayList(); // Implementation of Elitism protected static int ELITISM_K = 5; // Population size protected static int POPULATION_SIZE = 50 + ELITISM_K; // Max number of Iterations protected static int MAX_ITERATIONS = 200; // Probability of Mutation protected static double MUTATION_PROB = 0.05; // Probability of Crossover protected static double CROSSOVER_PROB = 0.7; // Instantiate Random object private static Random rand = new Random(); // Instantiate Population of Individuals private Individual[] startPopulation; // Total Fitness of Population private double totalFitness; Robot robot = new Robot(); Maze maze; public void setElitism(int result) { ELITISM_K = result; } public void setPopSize(int result) { POPULATION_SIZE = result + ELITISM_K; } public void setMaxIt(int result) { MAX_ITERATIONS = result; } public void setMutProb(double result) { MUTATION_PROB = result; } public void setCrossoverProb(double result) { CROSSOVER_PROB = result; } /** * Constructor for Population */ public RunGA(Maze maze) { // Create a population of population plus elitism startPopulation = new Individual[POPULATION_SIZE]; // For every individual in population fill with x genes from 0 to 1 for (int i = 0; i < POPULATION_SIZE; i++) { startPopulation[i] = new Individual(); startPopulation[i].randGenes(); } // Evaluate the current population's fitness this.evaluate(maze, startPopulation); } /** * Set Population * @param newPop */ public void setPopulation(Individual[] newPop) { System.arraycopy(newPop, 0, this.startPopulation, 0, POPULATION_SIZE); } /** * Get Population * @return */ public Individual[] getPopulation() { return this.startPopulation; } /** * Evaluate fitness * @return */ public double evaluate(Maze maze, Individual[] newPop) { this.totalFitness = 0.0; ArrayList<Double> fitnesses = new ArrayList<Double>(); for (int i = 0; i < POPULATION_SIZE; i++) { maze = new Maze(8, 8); maze.fillMaze(); fitnesses.add(startPopulation[i].evaluate(maze, newPop)); //this.totalFitness += startPopulation[i].evaluate(maze, newPop); } //totalFitness = (Math.round(totalFitness / POPULATION_SIZE)); StringBuilder sb = new StringBuilder(); for(Double tmp : fitnesses) { sb.append(tmp + ", "); totalFitness += tmp; } // Progress of each Individual //System.out.println(sb.toString()); return this.totalFitness; } /** * Roulette Wheel Selection * @return */ public Individual rouletteWheelSelection() { // Calculate sum of all chromosome fitnesses in population - sum S. double randNum = rand.nextDouble() * this.totalFitness; int i; for (i = 0; i < POPULATION_SIZE && randNum > 0; ++i) { randNum -= startPopulation[i].getFitnessValue(); } return startPopulation[i-1]; } /** * Tournament Selection * @return */ public Individual tournamentSelection() { double randNum = rand.nextDouble() * this.totalFitness; // Get random number of population (add 1 to stop nullpointerexception) int k = rand.nextInt(POPULATION_SIZE) + 1; int i; for (i = 1; i < POPULATION_SIZE && i < k && randNum > 0; ++i) { randNum -= startPopulation[i].getFitnessValue(); } return startPopulation[i-1]; } /** * Finds the best individual * @return */ public Individual findBestIndividual() { int idxMax = 0; double currentMax = 0.0; double currentMin = 1.0; double currentVal; for (int idx = 0; idx < POPULATION_SIZE; ++idx) { currentVal = startPopulation[idx].getFitnessValue(); if (currentMax < currentMin) { currentMax = currentMin = currentVal; idxMax = idx; } if (currentVal > currentMax) { currentMax = currentVal; idxMax = idx; } } // Double check to see if this has the right one //System.out.println(startPopulation[idxMax].getFitnessValue()); // Maximisation return startPopulation[idxMax]; } /** * One Point Crossover * @param firstPerson * @param secondPerson * @return */ public static Individual[] onePointCrossover(Individual firstPerson, Individual secondPerson) { Individual[] newPerson = new Individual[2]; newPerson[0] = new Individual(); newPerson[1] = new Individual(); int size = Individual.SIZE; int randPoint = rand.nextInt(size); int i; for (i = 0; i < randPoint; ++i) { newPerson[0].setGene(i, firstPerson.getGene(i)); newPerson[1].setGene(i, secondPerson.getGene(i)); } for (; i < Individual.SIZE; ++i) { newPerson[0].setGene(i, secondPerson.getGene(i)); newPerson[1].setGene(i, firstPerson.getGene(i)); } return newPerson; } /** * Uniform Crossover * @param firstPerson * @param secondPerson * @return */ public static Individual[] uniformCrossover(Individual firstPerson, Individual secondPerson) { Individual[] newPerson = new Individual[2]; newPerson[0] = new Individual(); newPerson[1] = new Individual(); for(int i = 0; i < Individual.SIZE; ++i) { double r = rand.nextDouble(); if (r > 0.5) { newPerson[0].setGene(i, firstPerson.getGene(i)); newPerson[1].setGene(i, secondPerson.getGene(i)); } else { newPerson[0].setGene(i, secondPerson.getGene(i)); newPerson[1].setGene(i, firstPerson.getGene(i)); } } return newPerson; } public double getTotalFitness() { return totalFitness; } public static void main(String[] args) { // Initialise Environment Maze maze = new Maze(8, 8); maze.fillMaze(); // Instantiate Population //Population pop = new Population(); RunGA pop = new RunGA(maze); // Instantiate Individuals for Population Individual[] newPop = new Individual[POPULATION_SIZE]; // Instantiate two individuals to use for selection Individual[] people = new Individual[2]; Action action = null; Direction direction = null; String result = ""; /*result += "Total Fitness: " + pop.getTotalFitness() + " - Best Fitness: " + pop.findBestIndividual().getFitnessValue();*/ // Print Current Population System.out.println("Total Fitness: " + pop.getTotalFitness() + " - Best Fitness: " + pop.findBestIndividual().getFitnessValue()); // Instantiate counter for selection int count; for (int i = 0; i < MAX_ITERATIONS; i++) { count = 0; // Elitism for (int j = 0; j < ELITISM_K; ++j) { // This one has the best fitness newPop[count] = pop.findBestIndividual(); count++; } // Build New Population (Population size = Steps (28)) while (count < POPULATION_SIZE) { // Roulette Wheel Selection people[0] = pop.rouletteWheelSelection(); people[1] = pop.rouletteWheelSelection(); // Tournament Selection //people[0] = pop.tournamentSelection(); //people[1] = pop.tournamentSelection(); // Crossover if (rand.nextDouble() < CROSSOVER_PROB) { // One Point Crossover //people = onePointCrossover(people[0], people[1]); // Uniform Crossover people = uniformCrossover(people[0], people[1]); } // Mutation if (rand.nextDouble() < MUTATION_PROB) { people[0].mutate(); } if (rand.nextDouble() < MUTATION_PROB) { people[1].mutate(); } // Add to New Population newPop[count] = people[0]; newPop[count+1] = people[1]; count += 2; } // Make new population the current population pop.setPopulation(newPop); // Re-evaluate the current population //pop.evaluate(); pop.evaluate(maze, newPop); // Print results to screen System.out.println("Total Fitness: " + pop.totalFitness + " - Best Fitness: " + pop.findBestIndividual().getFitnessValue()); //result += "\nTotal Fitness: " + pop.totalFitness + " - Best Fitness: " + pop.findBestIndividual().getFitnessValue(); } // Best Individual Individual bestIndiv = pop.findBestIndividual(); //return result; } } I have uploaded the full project to RapidShare if you require the extra files, although if needed I can add the code to them here. This problem has been depressing me for days now and if you guys can help me I will forever be in your debt.

    Read the article

  • Console Errors - Not a Jquery Guru Yet

    - by user2528902
    I am hoping that someone can help me to correct some issues that I am having with a custom script. I took over the management of a site and there seems to be an issue with the following code: /* jQUERY CUSTOM FUNCTION ------------------------------ */ jQuery(document).ready(function($) { $('.ngg-gallery-thumbnail-box').mouseenter(function(){ var elmID = "#"+this.id+" img"; $(elmID).fadeOut(300); }); $('.ngg-gallery-thumbnail-box').mouseleave(function(){ var elmID = "#"+this.id+" img"; $(elmID).fadeIn(300); }); var numbers = $('.ngg-gallery-thumbnail-box').size(); function A(i){ setInterval(function(){autoSlide(i)}, 7000); } A(0); function autoSlide(i) { var numbers = $('.ngg-gallery-thumbnail-box').size(); var elmCls = $("#ref").attr("class"); $(elmCls).fadeIn(300); var randNum = Math.floor((Math.random()*numbers)+1); var elmClass = ".elm"+randNum+" img"; $("#ref").attr("class", elmClass); $(elmClass).fadeOut(300); setInterval(function(){arguments.callee.caller(randNum)}, 7000); } }); The error that I am seeing in the console on Firebug is "TypeError: arguments.callee.caller is not a function. I am just getting started with jQuery and have no idea how to fix this issue. Any assistance with altering the code so that it still works but doesn't throw up all of these errors (if I load the site and let it sit in my browser for 10 minutes I have over 10000 errors in the console) would be greatly appreciated!

    Read the article

  • PHP reporting error. DB verify how to?

    - by iamfab
    Error reporting Notice: Undefined variable: random_chars in wamp\www\php_sandbox\idgen.php on line 21 Call Stack: # Time Memory Function Location 1 0.0045 678928 {main}( ) ..\idgen.php:0 GPB7446 How do I fix this error? Using this code like an automatic unique id generator. How do I connect to DB to verify code is truly unique before allowing it to be assigned to a user creating a new account? Thanks <?php $characters = array( "A","B","E","F","G","H","J","K","M","N","P","R","S","T","W","X","Y","Z"); $keys = array(); while(count($keys) < 3) { $x = mt_rand(0, count($characters)-1); if(!in_array($x, $keys)) { $keys[] = $x; } } foreach($keys as $key){ $random_chars .= $characters[$key];} $randNum = rand(2327,9987); $randLet = rand(2327,9987); echo $random_chars . $randNum; ?>

    Read the article

  • jQuery $.ajax Not Working in IE8 but it works on FireFox & Chrome

    - by Sam3k
    I have the following ajax call which works perfectly in Firefox and Chrome but not IE: function getAJAXdates( startDate, numberOfNights, opts ) { var month = startDate.getMonth() + 1; var day = startDate.getDate(); var year = startDate.getFullYear(); var d = new Date(); var randNum = Math.floor(Math.random()*100000000); $.ajax({ type : "GET", dataType : "json", url : "/availability/ajax/bookings?rand="+randNum, cache : false, data : 'month='+month+'&day='+day+'&year='+year+'&nights='+numberOfNights, contentType : 'application/json; charset=utf8', success : function(data) { console.log('@data: '+data); insertCellData(data, opts, startDate); }, error:function(xhr, status, errorThrown) { console.log('@Error: '+errorThrown); console.log('@Status: '+status); console.log('@Status Text: '+xhr.statusText); } }); } I know for a fact that all the variables are passing the right content and $.ajax is indeed passing all the paramater/values. This is what I get on error: LOG: @Error: undefined LOG: @Status: parsererror LOG: @Status Text: OK I'm aware of the cache issue on IE and implemented a random paramater to clear it up. Finally these are the headers that are sent back from the backend: header('Content-Type: application/json; charset=utf8'); header("Cache-Control: no-cache"); header("Expires: 0"); header('Access-Control-Max-Age: 3628800'); header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE');

    Read the article

  • Invoking methods on objects in java.

    - by David
    If i have a class called Dice which contains this method: public void roll () { this.x = randNum(1, this.sum.length) ; this.sum[x] ++ ; } And i am in a diferent class how do i invoke this method? I am currently trying InstanceOfObjectName.Dice.roll and its not working. What should i do?

    Read the article

  • assistance required, hangman game.

    - by Phillip Gibson
    I am making a hangman game and am having trouble with part of it. I have selected a random word from a file, but I want to display the word as a series of undersocres __ and then match the letter chosen to a position in the undersocres. Can anyone help me? cout <<"1. Select to play the game\n"; cout <<"2. Ask for help\n"; cout <<"3. Select to quit the game\n"; cout << "Enter a selection: "; int number; cin >> number; while(number < 1 || number > 3 || cin.fail()) { if(cin.fail()) { cin.sync(); cin.clear(); cout << "You have not entered a number, please enter a menu selection between 1 and 3\n"; cin >> number; } else { cout << "Your selection must be between 1 and 3!\n"; cin >> number; } } switch (number) { case 1: { string word; string name; cout << " Whats your name? "; cin >> name; Player player(); ifstream FileReader; FileReader.open("words.txt"); if(!FileReader.is_open()) cout << "Error"; //this is for the random selection of words srand(time(0)); int randnum = rand()%10+1; for(int counter = 0; counter < randnum; counter++) { getline(FileReader, word, '\n'); } cout << "my word: " << word << "\n"; // get length of word int length; //create for loop for(int i = 0; i < length; i++) cout << "_"; //_ _ _ _ _ SetCursorPos(2,10); FileReader.close(); break;

    Read the article

  • Will this ever result in a stack overflow error?

    - by David
    Will incrementing the instance variables of an object ever lead to a stack overflow error? For example: This method (java) will cause a stack overflow error: class StackOverflow { public static void StackOverflow (int x) { System.out.println (x) ; StackOverflow(x+1) ; } public static void main (String[]arg) { StackOverflow (0) ; } but will this?: (..... is a gap that i've put in to shorten the code. its long enough as it is.) import java.util.*; class Dice { String name ; int x ; int[] sum ; .... public Dice (String name) { this.name = name ; this.x = 0 ; this.sum = new int[7] ; } .... public static void main (String[] arg) { Dice a1 = new Dice ("a1") ; for (int i = 0; i<6000000; i++) { a1.roll () ; printDice(a1) ; } } .... public void roll () { this.x = randNum(1, this.sum.length) ; this.sum[x] ++ ; } public static int randNum (int a, int b) { Random random = new Random() ; int c = (b-a) ; int randomNumber = ((random.nextInt(c)) + a) ; return randomNumber ; } public static void printDice (Dice Dice) { System.out.println (Dice.name) ; System.out.println ("value: "+Dice.x) ; printValues (Dice) ; } public static void printValues (Dice Dice) { for (int i = 0; i<Dice.sum.length; i++) System.out.println ("#of "+i+"'s: "+Dice.sum[i]) ; } } The above doesn't currently cause a stack overflow error but could i get it too if i changed this line in main: for (int i = 0; i<6000000; i++) so that instead of 6 million something sufficiently high were there?

    Read the article

  • Difficulty in Understanding Slideshow script

    - by shining star
    I have taken slide show script from net. But There some functions i cannot understand here is script <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd" > <html lang="en"> <head> <title></title> <script> var interval = 1500; var random_display = 0; var imageDir = "my_images/"; var imageNum = 0; imageArray = new Array(); imageArray[imageNum++] = new imageItem(imageDir + "01.jpg"); imageArray[imageNum++] = new imageItem(imageDir + "02.jpg"); imageArray[imageNum++] = new imageItem(imageDir + "03.jpg"); imageArray[imageNum++] = new imageItem(imageDir + "04.jpg"); imageArray[imageNum++] = new imageItem(imageDir + "05.jpg"); var totalImages = imageArray.length; function imageItem(image_location) { this.image_item = new Image(); this.image_item.src = image_location; return this.image_item.src; } function get_ImageItemLocation(imageObj) { return(imageObj.image_item.src) } alert(imageArray[imageNum].image_item.src); function randNum(x, y) { var range = y - x + 1; return Math.floor(Math.random() * range) + x; } function getNextImage() { if (random_display) { imageNum = randNum(0, totalImages-1); } else { imageNum = (imageNum+1) % totalImages; } var new_image = get_ImageItemLocation(imageArray[imageNum]); //alert(new_image) return(new_image); } function getPrevImage() { imageNum = (imageNum-1) % totalImages; var new_image = get_ImageItemLocation(imageArray[imageNum]); return(new_image); } function prevImage(place) { var new_image = getPrevImage(); document[place].src = new_image; } function switchImage(place) { var new_image = getNextImage(); document[place].src = new_image; var recur_call = "switchImage('"+place+"')"; timerID = setTimeout(recur_call, interval); } </script> </head> <body onLoad="switchImage('slideImg')"> <img name="slideImg" src="27.jpg" width=500 height=375 border=0> <a href="#" onClick="switchImage('slideImg')">play slide show</a> <a href="#" onClick="clearTimeout(timerID)"> pause</a> <a href="#" onClick="prevImage('slideImg'); clearTimeout(timerID)"> previous</a> <a href="#" onClick="switchImage('slideImg'); clearTimeout(timerID)">next </a> </body> </html> here exactly i dont know what does acctually function of get_ImageItemLocation(imageObj) and imageItem(image_location) what does these two functions seperately? Thanks in advance for attention

    Read the article

  • Javascript CS-PRNG - 64-bit random

    - by Jack
    Hi, I need to generate a cryptographically secure 64-bit unsigned random integer in Javascript. The first problem is that Javascript only allows 64-bit signed integers, so 9223372036854775808 is the biggest supported integer without going into floating point use I think? To fix this I can use a big number library, no problem. My Method: var randNum = SHA256( randBigInt(128, 0) ) % 2^64; Where SHA256() is a secure hash function and randBigInt() is defined below as a non-crypto PRNG, im giving it a 128bit seed so brute force shouldn't be a problem. randBigInt(n,s) //return an n-bit random BigInt (n>=1). If s=1, then the most significant of those n bits is set to 1. Is this a secure method to generate a cryptographically secure 64-bit random int? And importantly does taking the 2^64 mod guarantee 100% I have a 64-bit number? An abstract example, say this number is prime (it isn't i know), I will use it in the Galois Field [2^p], where p must be 64bits so that every possible 1-63bit number is a field element. In this query, my random int must be larger than any 63-bit number. And Im not sure im correct in taking the 2^64 mod of a 256bit hash output. Thanks (hope that makes sense)

    Read the article

  • Printing an array in a method, from a different class?

    - by O.Lodhi
    Hello All, I'm a fairly inexperienced programmer, and i'm currently working on a Console Application project. It's basically a little 'mathematics game'; the application generates two random numbers, that have either been added, subtracted, multiplied or divided against each other randomly. The answer is shown on screen and the user has to pick from the menu which is the right mathematical operator, once the correct answer is picked the application then displays on screen how long it took for the user in milliseconds to input the correct answer. Now I want to save the times of the players in an array that can be called up later with all the scores. I need to include a method in this programme and I figured a method to save the times into an array would be suitable. I seem to have stumbled across a little problem though. I'm not quite sure what's wrong: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Mathgame { class Program { } class arrayclass { public static void saveInArray(int duration) { int[] TopTenScores = {000,1000,2000,3000,4000,5000,6000,7000,8000,9000}; if (duration < 1000) { duration = TopTenScores[000]; } else if ((duration >= 1000) && (duration <= 1999)) { duration = TopTenScores[1000]; } else if ((duration >= 2000) && (duration <= 2999)) { duration = TopTenScores[2000]; } else if ((duration >= 3000) && (duration <= 3999)) { duration = TopTenScores[3000]; } else if ((duration >= 4000) && (duration <= 4999)) { duration = TopTenScores[4000]; } else if ((duration >= 5000) && (duration <= 5999)) { duration = TopTenScores[5000]; } else if ((duration >= 6000) && (duration <= 6999)) { duration = TopTenScores[6000]; } else if ((duration >= 7000) && (duration <= 7999)) { duration = TopTenScores[7000]; } else if ((duration >= 8000) && (duration <= 8999)) { duration = TopTenScores[8000]; } else if ((duration >= 9000) && (duration <= 9999)) { duration = TopTenScores[9000]; } Console.WriteLine(TopTenScores); } static void Main(string[] args) { int intInput, num1, num2, incorrect, array1; float answer; string input; System.Random randNum = new System.Random(); Console.WriteLine("Welcome to the Maths game!"); Console.WriteLine("(Apologies for the glitchiness!)"); Console.WriteLine(); Console.WriteLine("Please choose from the following options:"); Console.WriteLine(); retry: Console.WriteLine("1 - Test your Maths against the clock!"); Console.WriteLine("2 - Exit the application."); Console.WriteLine("3 - Top scores"); Console.WriteLine(); input = Console.ReadLine(); intInput = int.Parse(input); if (intInput == 1) { goto start; } else if (intInput == 2) { goto fin; } else if (intInput == 3) { array1 = array1.saveInArray; goto retry; } Now, in the last 'else if' statement in the code, you can see my variable array1 trying to call the method, but no matter what I do I keep getting errors. This is the only error I have at the moment, but I have a feeling soon as I resolve that error, another will come up. For now i'm just determined to get past this error: 'int' does not contain a definition for 'saveInArray' and no extension method 'saveInArray' accepting a first argument of type 'int' could be found (are you missing a using directive or an assembly reference?). Any help would be kindly appreciated, apologies in advanced for my ugly written code! And thank you to any help that I receive! Regards, Omar.

    Read the article

1