Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. Ingolme

    function

    The join() method turns an array into a string. The concat() method combines arrays. You will need to use concat() to combine them. If you want to turn that into a string then just call join() on the array that results from the concat() operation.
  2. Are you hiring or just looking for free help? It's going to be difficult to get anybody to work on a project of this scale without compensation.
  3. If you select "Print..." in Google Chrome, and click on "More options" in the left column there's a checkbox lebeled "Background graphics"
  4. Ingolme

    best editor ?

    PHP, HTML and CSS work together, each one performing a different function. You cannot substitute one with another, they are all necessary.
  5. Ingolme

    programming

    Can you point to an article where you read about reversing code? It depends on the context. Reversing a string means putting the letters in reverse order, "Hello, World!" becomes "!dlorW ,olleH" Reversing a function would be to make a function that does the opposite, which I explained in my previous post. Reversing the order of execution would mean writing the lines of code in reverse order.
  6. Ingolme

    loop context

    You seem to have misunderstood. What makes no difference is where the var keyword is, but what does make a difference is where the assignment is. That means these two blocks of code should behave the same: var hunter;hunter = 0;for(i=0; i<4;i++){hunter = hunter+i;}document.write(hunter); hunter = 0;for(i=0; i<4;i++){var hunter;hunter = hunter+i;}document.write(hunter);
  7. Ingolme

    programming

    I assume what it means is to create a function that takes what the other one outputs and return what was put into it. That is, if function A takes in 5 and outputs 23, then function B needs to take in 23 and output 5. Your code doesn't seem to have any inputs, so perhaps that definition doesn't fit. Where did you find the question?
  8. The id is used when you want to reference an element that is unique, when there is only one on the page. A class can be used to give a same style to multiple different elements. The id is also used by Javascript to easily access an element.
  9. Ingolme

    math2

    This isn't a programming problem. It's a math problem. The solution to your question is difficult. What makes it even more difficult is that the number of variables is variable in itself. Let's start with just one variable: a = 1286 a mod 65537 = 16628 There is no solution to this because the system is incompatible. Now two variables: a + b = 1286 a*b mod 65537 = 16828 We can use any of the three methods of two variable equations to find it out. For example, singling out a in both equations a = 1286 - b a*b = 16828 + 65537 → a = (16828 + 65537) / b therefore 1286 - b = (16828 + 65537) / b which leads to -b2 + 1286*b - 82365 Now we have a quadratic equation to solve. I asked Wolfram Alpha to solve it and I got this: http://www.wolframalpha.com/input/?i=-x^2+%2B+1286x+-+82365+%3D+0 Quadratic equations have two possible solutions, so here they are approximated: a = 1218.399 b = 67.601 a = 67.6 b = 1218.4 Would you like to find the solution for three variables?
  10. I'll attach a working script to this post. In this program, tiles[] is an array with four numbers. The numbers are reordered when the user clicks on the image elements. The game logic is in the move() function, the presentation is in the display() function. I copied the specifications of your current program, in your current program it's always tile 3 that gets moved when a user clicks on the puzzle so I kept it that way. test.html
  11. You're having a problem separating logic from presentation. Your current tiles[] array is actually used to reference HTML elements and has no numbers in it. You need another different array to keep track of the order of the tiles. What would be ideal is that you did all the operations with just numbers. Forget the HTML exists while doing the game logic. Have a separate program that reads data from the arrays and manipulates the page's HTML to represent that data.
  12. A web designer, somebody who only deals with the visual aspects of the page, only needs to know HTML, CSS, Javascript and some image manipulation program. A web developer needs to know HTML, CSS, Javascript in much more depth, at least one server-side language, database theory, and they need to understand the HTTP protocol. There's no need to understand DNS as a web designer or developer. That's for server administrators to deal with.
  13. Ingolme

    math2

    You might want to use MATLAB to solve problems if you run into them this frequently. It's a command line for working with math. It has a steep learning curve, though. You can just try to solve them on paper. The more variables you have the more difficult it is to find a solution to a problem and you have a whole lot of them.
  14. No, you don't need to unset it, you need to reset it. Set the pointer back to zero. You can do that using the data_seek() method.
  15. That looks correct, but I can't tell for sure, what are the chances that the values of st and en are exactly equal to the values of tfrom and ttill? The number has millisecond precision, if it's off by just one millisecond the condition will return false. I assume after the loop you'll be returning true, otherwise the person calling the function is going to get a value that always evaluates to false.
  16. Leave the padding at 0px. Is there any other CSS being applied to the menu items? I can't tell without seeing the page myself. You have some HTML validation errors which might affect the way the browser renders CSS. Find and fix errors in your code here: http://validator.w3.org/
  17. That's a good solution. Depending on what kind of data follows, perhaps a table might suit the data.
  18. Perhaps this is what you're trying to do: function sum () { var c = 3 ; var b = 2; var a = c+b; if(a==5) { alert("good"); } else { alert("wrong"); }} Or this: function sum(b, c) { return b + c;}var a = sum(3, 2);if(a == 5) { alert("good");} else { alert("wrong");}
  19. Ingolme

    step zero js

    You'll first need to get the innerHTML property of the element. In your if() statement you need to use comparison operators, a single = is an assignment operator which is something different.
  20. You can't have block elements inside a paragraph, that includes other paragraphs as well. Replace the inner paragraph with a <span> instead.
  21. Ingolme

    definition

    That's not context. What is the paragraph you read it in?
  22. Ingolme

    definition

    I don't know. It depends on the context. Where did you see it written?
  23. I think leaving spaces between the slashes should prevent the editor from being confused.
  24. It appears you've created a function named testing() but never call it at any point, so it never runs. I would suggest declaring all your functions in the global scope unless you have a good reason not to.
  25. Ingolme

    value

    Using the function keyword there will cause an error. Press F12 to open developer tools and see any errors your code is having. You don't seem to understand functions, read about how to create and call functions here: http://www.w3schools.com/js/js_functions.asp
×
×
  • Create New...