Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8879381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:56:15+00:00 2026-06-14T19:56:15+00:00

I have a node.js chat app that uses socket.io and other dependencies but I

  • 0

I have a node.js chat app that uses socket.io and other dependencies but I have no db currently.

I would like some advice on how to approach this and how to implement it, as I’m working on an app where when 2 users at some point have a matching message, they don’t have to have the matching message at the same time.

User1 might of said the word “apple” at the start of the chat and user2 might of said apple half through the chat. When this match occurs they both get points. I’ve been looking around for a good base chat app that might facilitate this but nothing I’ve found has met that.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T19:56:18+00:00Added an answer on June 14, 2026 at 7:56 pm

    This is how i could implement the whole game. Its clear that you will get the answers from both players. I guess that in your chat programm you’d have something of an identifier to check for the users ID and their chat session, so I’m not going to bother with this. I think that the implementation of sending a new “question” for their matching task shouldnt be a problem by just doing a simple

    setTimeout(function(){ io.emit('newQuestion', {picture: randomPicture})}, 120000);
    

    The string match should be another task. This could be easily done in javascript. As you are just trying to match complete strings, I would go about this as follows. Suppose you have a chat string1 and chat string2 corresponding to user1 and user2. From there you will need to cross reference all words in string1 with string2. For this string1 has to be broken apart.

    var string1 = "apple half";
    var string2 = "an apple";
    var string1Split = string1.split(" ");
    
    var match = false;
    
    for(i=string1Split.length; i--;) {
     result = str.match(/string1Split[i]/g);
     if(result.length > 0 && match == false) {
      match = true;
     }
    }
    
    if(match) {
     //add points to it
    }
    

    I’m not sure if you have to replace the quotes ‘ ” ‘ in your string1Split[i] but thats just a matter of doing another regexp.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a chat application using Node.js, and would like to have a
Currently i have a node.js and socket.io application in development on my local machine
Currently I have the following code, working with Node.js, socket.io and Redis: var io
So I am using node.js and socket.io. I have this little program that takes
I'm writing a multi-room chat app with Node.js and Socket.IO and I'm wondering how
I have a Node.js web server that runs a socket server on top, which
I currently have a web based private chat application that is going very well.
I am writing a rails app, and I would like to use node.js and
Let me explain best with an example. Say you have node class that can
I have a node.js (v0.6.12) application that starts by evaluating a Javascript file, startup.js.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.