Jump to content

voldelord

Member
  • Posts

    24
  • Joined

  • Last visited

Awards

Profile Information

  • Gender
    Male
  • Location
    The Netherlands
  • Occupation
    Student

System

  • CPU
    i5 4670k
  • Motherboard
    Asrock z87m Extreme 4
  • RAM
    8gb DDR3-1866
  • GPU
    Club3D R9 290 royalAce
  • Case
    Silverstone TJ08e
  • Operating System
    Windows

Recent Profile Visitors

979 profile views

voldelord's Achievements

  1. You could make the columns ArrayLists, then removing an element would also remove the gap. Otherwise you could iterate through each column until you encounter a gap, lower each element above the gap, then continue your search.
  2. Well, I'm from the Netherlands, on windows 10 and using BitTorrent without any problems.
  3. Most of the time the automated online tests are only done to check if the code works. After that, at least in my experience, the code will be checked by the lecturers or assistants. Mostly so that they can give feedback and critique your coding.
  4. I do not have 750 ti myself but from what I can find you will not reach 60 fps at 1080p. You'd get about 40 fps at 1080p. Benchmark using 750ti and i5-4670k: http://www.game-debate.com/news/?news=16906&game=The%20Witcher%20III&title=The%20Witcher%203%20Benchmarks%20GeForce%20GTX%20750%20Ti
  5. What you could is when multiplying your factorial count and remove the zeros at the end of your result. Then to simplify future calculations only continue with the last x digits of the result. I verified my algorithm, each time continuing with the last 5 digits, by testing the results using a Big number library and found that it was accurate past 80,000 factorial (19995). Iteration: current: 1 count: 0 current: 2 count: 0 current: 6 count: 0 current: 24 count: 0 current: 12 count: 1 current: 72 count: 1 current: 504 count: 1 current: 4032 count: 1 current: 36288 count: 1 current: 36288 count: 2 current: 99168 count: 2 current: 90016 count: 2 current: 70208 count: 2 I hope this helps.
  6. It ran without errors , but testing it revealed that I couldn't perform the Castling move. https://en.wikipedia.org/wiki/Castling
  7. you could use String.indexOf(substring,start) where 'start' is the location in the string where you want to start the search. This returns the first location where the substring occurs, you can then start the search again at that location+substring.length(). Repeat untill indexOf returns -1 (doesn't find anything). So something like this: while(start!= -1){ start= input.indexOf(substring,start); if(start!= -1){ count ++; start+= substring.length(); }}
  8. Hi, the reason that the code is not running, is that the variables JuiceCheck CoffeeCheck MilkCheck etc. Have not been initialized when you used them, you declared them, but when you try to initialize using initialize(); you make new (local) variables instead of initializing the ones you declared. When initializing a variables already declared you have to do the following: private JRadioButton FemaleButton; //declarebutFemale = new JRadioButton("Female"); //initializeJRadioButton butFemale = new JRadioButton("Female"); //Here you declare a new variable and initialize it in 1 line If you correct it for all variables in initialize(); the program works.
  9. That your program doesn't output anything (or takes a very long time) with more than 10 iterations is not surprising. Only talking about i(n): i(0) immediately returns the answer For i(1) you need to rerun i(0) 3 times and run s(0) and perform calculations with those for i(2) you need to run i(1) 3 times so you run i(0) 9 times. But you also need to run s(1) which needs s(0) and s(1) This goes up exponentially with more iterations, and since you do not print the results between iteration but only when you have all the answer it can seem to get stuck. Having said that I corrected to program using your tactic: package amina;public class amina { public static void main (String args[]) { double s [] = new double [300]; double i [] = new double [300]; double r [] = new double [300]; //int h = 1; i[0] = 0.00000019; s[0] = 1; r[0] = 0; System.out.println("n\ti\ts\tr"); for (int n = 1; n<200; n++) { i[n] = i(n); s[n] = s(n); r[n] = r(n); System.out.println(n); } output(s, i, r); } public static void output(double s [], double i [], double r []) { for (int j = 0; j<200; j++) { System.out.println(j + "\t" + i[j] + "\t" + s[j] + "\t" + r[j]); } } public static double i(int n) { double i = 0; if (n==0) return 0.00000019;; i = i(n-1) + (s(n-1) * i(n-1)/2) - (i(n-1)/10 ); //System.out.println("i"); return i; } public static double s(int n) { double s; if (n==0) return 1;; s = s(n-1) - (s(n-1) * i(n-1)/2 ); //System.out.println("s"); return s; } public static double r(int n) { double r; if (n==0) return 0;; r = r(n-1) + (i(n-1)/10 ); //System.out.println("r"); return r; }} I rewrote the formula to include less operators so instead of i(n)= i(n-1) + ((1/2) * 1 * s(n-1) * i(n-1) ) - ((1/10) * 1 * i(n-1) ) I used i(n) = i(n-1) + (s(n-1) * i(n-1)/2 ) - i(n-1)/10 As far as I now the calculations are done correctly (haven't checked by hand) but the program calculates the numbers means it is not feasible for a high number if iterations. It took about 10 minutes to do the first 20 iterations and it will only get worse. My advice would be to think of a way to use previously calculated or given values to calculate the next value.
  10. public static double i(int n) { double i; i = i(n) + ((1/2) * 1 * s(n) * i(n) ) - ((1/10) * 1 * i(n) ); //System.out.println("i"); return i; } The following also applies to the function s() and r(). You are trying to program a recursive function so you should do the following: Check if you reached the base case (in this case n=0) if so return the answer Otherwise calculate the answer using the formula (this step should get you closer to the base case) You don't do the first one so your code will not terminate. You tried to do the second one but forgot to lower the value of n before inserting it in the function, this way you never reach the base case. It might be easier to use the rewritten form and go on from there: i(n) = i(n-1) + ((1/2) * 1 * s(n-1) * i(n-1) ) - ((1/10) * 1 * i(n-1) ) On a side note it would be easier to calculate your number using the numbers you already have: i[n] = i[n-1] + ((1/2) * s[n-1] * i[n-1] ) - ((1/10) * i[n-1] ) This way the program does not continously recalculate parts it already solved.
  11. You can adjust your difficulty setting at any time, under: options - gameplay - Difficulty level.
  12. Both Witcher 3 and GTAV store your savegames in the documents folder: Witcher 3: ..\Documents\The Witcher 3\gamesaves. GTA5: ..\Documents\Rockstar Games\GTA V\Profiles
  13. voldelord https://www.vessel.com/videos/JYZEYDYx0 https://www.vessel.com/videos/MI7F0u2H8
×