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.
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
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
string1and chatstring2corresponding to user1 and user2. From there you will need to cross reference all words instring1withstring2. For thisstring1has to be broken apart.I’m not sure if you have to replace the quotes ‘ ” ‘ in your
string1Split[i]but thats just a matter of doing another regexp.