Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. JavaScript
  4. JS Question

JS Question

Scheduled Pinned Locked Moved JavaScript
questionjavascripthelp
34 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Hakan Bulut

    :thumbsup:

    Hakan cursed chats dealer :)

    H Offline
    H Offline
    Hakan Bulut
    wrote on last edited by
    #24

    I used to ur method

    var arrIns = [
    "1","21","24","28","42","48",
    "9","13","14","16","24","49",
    "3","18","19","25","44","45"
    ];
    var arr = [];
    var AllLucky= [];
    var ct = 0;
    var n = 0;

    do{
    for(var i=arrIns.length; i>0; --i)
    {
    arrIns[i] = arr[i];
    for(var j=0; j<arrIns.lenght; j++)
    {
    if(!arrIns[arr[j]]) {
    arrIns[arr[j]] = AllLucky[ct];
    document.write(AllLucky[ct] + "<BR>");
    ct++; n++;
    }
    }
    }
    }while(n<1);

    output is 24 must be ?

    Hakan cursed chats dealer :)

    D 2 Replies Last reply
    0
    • H Hakan Bulut

      I used to ur method

      var arrIns = [
      "1","21","24","28","42","48",
      "9","13","14","16","24","49",
      "3","18","19","25","44","45"
      ];
      var arr = [];
      var AllLucky= [];
      var ct = 0;
      var n = 0;

      do{
      for(var i=arrIns.length; i>0; --i)
      {
      arrIns[i] = arr[i];
      for(var j=0; j<arrIns.lenght; j++)
      {
      if(!arrIns[arr[j]]) {
      arrIns[arr[j]] = AllLucky[ct];
      document.write(AllLucky[ct] + "<BR>");
      ct++; n++;
      }
      }
      }
      }while(n<1);

      output is 24 must be ?

      Hakan cursed chats dealer :)

      D Offline
      D Offline
      dusty_dex
      wrote on last edited by
      #25

      I will take a look at today's messages later tonight. there is spelling mistake, length

      for(var j=0; j

      :)

      Q. Are you trying to create a 2D table that indexes all of arrIns?

      0, "1"
      12, "3"
      6, "9"
      .
      .
      11, "49"

      the line below is deleting arrIns[i] items.

      problem is arr[i] = undefined (empty like c++ void).
      so, arrIns[i] = undefined.

      arrIns[i] = arr[i];

      Not enough code to test it.
      I need array AllLucky. ;)

      "It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan

      That's what machines are for.

      Got a problem?
      Sleep on it.

      1 Reply Last reply
      0
      • H Hakan Bulut

        I used to ur method

        var arrIns = [
        "1","21","24","28","42","48",
        "9","13","14","16","24","49",
        "3","18","19","25","44","45"
        ];
        var arr = [];
        var AllLucky= [];
        var ct = 0;
        var n = 0;

        do{
        for(var i=arrIns.length; i>0; --i)
        {
        arrIns[i] = arr[i];
        for(var j=0; j<arrIns.lenght; j++)
        {
        if(!arrIns[arr[j]]) {
        arrIns[arr[j]] = AllLucky[ct];
        document.write(AllLucky[ct] + "<BR>");
        ct++; n++;
        }
        }
        }
        }while(n<1);

        output is 24 must be ?

        Hakan cursed chats dealer :)

        D Offline
        D Offline
        dusty_dex
        wrote on last edited by
        #26

        please explain your signature: Hakan cursed chats dealer :) If you are just messing people about, I will stop helping right now. :mad:

        "It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan That's what machines are for. Got a problem? Sleep on it.

        H 1 Reply Last reply
        0
        • D dusty_dex

          please explain your signature: Hakan cursed chats dealer :) If you are just messing people about, I will stop helping right now. :mad:

          "It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan That's what machines are for. Got a problem? Sleep on it.

          H Offline
          H Offline
          Hakan Bulut
          wrote on last edited by
          #27

          Just kidding!! Please don't offense on you.

          Hakan cursed chats dealer :)

          D 1 Reply Last reply
          0
          • H Hakan Bulut

            Just kidding!! Please don't offense on you.

            Hakan cursed chats dealer :)

            D Offline
            D Offline
            dusty_dex
            wrote on last edited by
            #28

            ok. :| post message explain the arrays, differences AllLucky arrIns arr :confused: Help me to see what each one will look like at the end of code.

            "It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan That's what machines are for. Got a problem? Sleep on it.

            H 1 Reply Last reply
            0
            • D dusty_dex

              ok. :| post message explain the arrays, differences AllLucky arrIns arr :confused: Help me to see what each one will look like at the end of code.

              "It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan That's what machines are for. Got a problem? Sleep on it.

              H Offline
              H Offline
              Hakan Bulut
              wrote on last edited by
              #29

              if(!arrIns[arr[j]])

              is 24 AllLucky[ 24 ] differencly

              H 1 Reply Last reply
              0
              • H Hakan Bulut

                if(!arrIns[arr[j]])

                is 24 AllLucky[ 24 ] differencly

                H Offline
                H Offline
                Hakan Bulut
                wrote on last edited by
                #30

                9 10 38 40 46 48

                there is no pick number this week too :) lotto combination is uselessness

                D 2 Replies Last reply
                0
                • H Hakan Bulut

                  9 10 38 40 46 48

                  there is no pick number this week too :) lotto combination is uselessness

                  D Offline
                  D Offline
                  dusty_dex
                  wrote on last edited by
                  #31

                  Q1. is arr[] lucky numbers to add to existing ? Q2. So, you want to add new set of lucky numbers to arrIns, but only if they do not exist in arrIns. Yes? =============================================== from what you told me before I thought old lucky numbers would get replaced var arrIns = [ "1","21","24","28","42","48", // week-2 is removed "9","10","38","40","46","48" // this is new week-2 set "9","13","14","16","24","49", "3","18","19","25","44","45", ]; or var arrIns = [ "1","21","24","28","42","48", "9","13","14","16","24","49", "3","18","19","25","44","45", "9","10","38","40","46","48" // new week-2 ]

                  "It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan That's what machines are for. Got a problem? Sleep on it.

                  1 Reply Last reply
                  0
                  • H Hakan Bulut

                    9 10 38 40 46 48

                    there is no pick number this week too :) lotto combination is uselessness

                    D Offline
                    D Offline
                    dusty_dex
                    wrote on last edited by
                    #32

                    If you get Java SE JRE7 & also install this Rhino Shell You can experiment with Javascript and learn things better. Using a web browser is no good for learning. I will help you get it set up and how to use it. :)

                    "It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan That's what machines are for. Got a problem? Sleep on it.

                    H 1 Reply Last reply
                    0
                    • H Hakan Bulut

                      Documentation The lucky numbers, I want to compare the values ​​that are encountering the same. Anyone can help on this topic?

                      .
                      .
                      if(arrLot\[i\] == arrIns\[18\])
                      if(arrLot\[i\] == arrIns\[19\]){
                          lucky\[add++\] = arrLot\[i\];
                          if(lucky\[add++\] = arrLot\[i\]) {
                              lucky\[add++\] = gb;
                          }
                      }
                      

                      }
                      var gb = getBNS();
                      function getBNS()
                      {
                      var mf = 0;
                      return Math.floor(mf+=1);
                      }

                      do{
                      if(gb.mf > 1){
                      lucky[ct].sort(function(a,b){
                      return a-b}); // end sort
                      }
                      document.write(lucky[ct] + " : " + gb + "<BR>");
                      ct++;
                      }while(ct<17);

                      mesela burada 18 adet sayı elemanlarını kendi aralarında karşılaştırdıktan sonra hangi sayının ne kadar karşılaştığını hesaplayan ve dökümanlayan bir kod yazmaya çalışıyorum. Tanımla problemi var. mesela şöyle bir çıktı veriyor:

                      <pre>

                      Undefined : 1 Undefined : 1 Undefined : 1 Undefined : 1

                      var arrIns = [
                      "1","21","24","28","42","48",
                      "9","13","14","16","24","49",
                      "3","18","19","25","44","45"
                      ];

                      Burada çıktı

                      24 : 2
                      1 : 1
                      21 : 1

                      olmalı..

                      J Offline
                      J Offline
                      jkirkerx
                      wrote on last edited by
                      #33

                      If your working with numbers, why make them strings, how are you going to test if 1 number is less than the other number?, Why not just work with numbers?

                      var arrIns = [
                      1,21,24,28,42,48,
                      9,13,14,16,24,49,
                      3,18,19,25,44,45
                      ];

                      1 Reply Last reply
                      0
                      • D dusty_dex

                        If you get Java SE JRE7 & also install this Rhino Shell You can experiment with Javascript and learn things better. Using a web browser is no good for learning. I will help you get it set up and how to use it. :)

                        "It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan That's what machines are for. Got a problem? Sleep on it.

                        H Offline
                        H Offline
                        Hakan Bulut
                        wrote on last edited by
                        #34

                        Thanks for Java SDKs

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups