Constraint problem : Algorythm. Tinder-like

Hello Bubblers !

I built a webapp with a system similar to tinder (Like/Dislike/Match), I’m stuck on one point.
I’d like to show the current user randomly (1/2 or 1/3) users who liked him.
I managed with the constraint to show all the users who liked him but I couldn’t make these users be spread among all the users, moreover once all the users who liked me are empty, the constraint continues to act and therefore doesn’t show the users who haven’t liked me yet.

Do you have any idea how I could do this?

Thank you !!

Up, any idea ?

Hey guys, I’m stuck still, does anyone have any idea how I could do this?

I’m not entirely sure if I understand you correctly, but:

use sorted randomly?
image

“spread among all the users” you mean randomly showing people who liked me right? again try random sorting.

It sound like simple constraint: When: Do a search for: people who like me count is 0 then data source: do a search for people who haven’t liked me yet.

Hello, thank you for your answer !

I wasn’t clear with the term “random”, I would like a user who liked me to appear more often in order to make the Match easier.
Today I have a lot of users so the probability of being shown a person who liked me is low.
I would like the probability to be 1 in 3 for example.
The problem is the “ramdom sorting” does not allow me to do or I made a mistake :wink:

oh I see. Yes, so I misunderstood you completely. That’s an interesting problem. I will think about it let you know if I have some ideas.

Okay so I would do it like that:

Have a constraint within the RG that refers to state on it - let’s call it NUMBER.
The default state for NUMBER is 1.

After the swipe make the NUMBER = NUMBER + 1

Now the constraint:

  1. If the NUMBER <3 show the people who didn’t like me yet.
  2. If the NUMBER is 3 show the people who liked me.

In the workflows: if the NUMBER is 3 set NUMBER to 1.

And the cycle goes.

So in the end it should show you one person who liked me for every two that didn’t liked me yet.

Great, that’s smart ! I’ll try it as soon as I get home from work. Thanks a lot!

1 Like

It’s working! Thanks for your help @bartek.dev

Have a nice day!

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.