pseudocoder10's blog

By pseudocoder10, history, 2 months ago, In English,

Hello everyone, I'm sure many of you have been watching and enjoying the recent lockout streams organized by ecnerwala and scott_wu and would be wanting to compete with your friends in a similar format. I have made a discord bot that does exactly the same. The source code for the bot can be found here.

The bot gives a set of 5 problems with ratings from [x, x+400], where x is chosen by you and the point distribution is [100, 500]. The first person to solve a problem gets the points for it. The match ends when someone has >= 800 points or 45 minutes have been elapsed. The bot automatically updates the status when someone solves a problem but you can also do it manually.

To invite the bot to your discord server, click here. If you don't wanna go through the hassle of setting up a discord server, join this server to try the bot instantly.

Steps to use

First you will have to link your codeforces handle with your discord id. To do that type .handle identify <cf username>. The bot will give you a random string, which you have to set as your first name in your profile. On successfully doing that, you will be able to compete with others.

Ex

Now you can challenge your opponent by typing .match challenge <opponent discord name> <rating>. The bot will now give problems in the range [rating, rating+400] if your opponent accepts the match.

Ex

To accept a challenge, simply type .match accept and the bot will chose 5 random unsolved problems by both the participants in the rated range given.

Ex

The bot will automatically update the status of the match, but you can also manually trigger it by typing .match update.

Ex

The bot has few more features which you can try out yourself by joining this server. Any suggestions to make it better are welcomed.

UPD: If you want to report any bug or make suggestions, it will be better to comment in the support server rather than commenting here, since I will be able to respond faster and there will be better communication.

 
 
 
 
  • Vote: I like it
  • +496
  • Vote: I do not like it

»
2 months ago, # |
  Vote: I like it +135 Vote: I do not like it

Here..
IMG-20200609-012417

»
2 months ago, # |
  Vote: I like it +5 Vote: I do not like it

Adding a music bot on the server pairs well :D

Link: Octave

»
2 months ago, # |
  Vote: I like it +57 Vote: I do not like it

Excellent bot; many thanks for setting it up!

A few suggestions, with respect to match configuration: it'd be great if we could change the specific rating for each problem (rather than increments of 100), the number of problems in the set, the score for each problem, and the time limit.

From a server administration standpoint, it'd also be helpful to have the option to disable the bot in certain channels, to limit spam. It seems likely that many servers would rather dedicate one channel to the bot, and would thus prefer to disable it everywhere else.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +11 Vote: I do not like it

    Yes, seconded! Please let us change time limits.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +34 Vote: I do not like it

    For the second point, you can do this via discord itself:

    Go to the channel settings/permissions and you'll be able to specify permissions for the bot, you can just disable Read Messages.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +17 Vote: I do not like it

    Thanks for the suggestions, I'll definitely try to implement them, and as Mohammad_Yasser suggested, its better to manually remove read messages permission for channels where you don't want the bot to send messages.

»
2 months ago, # |
Rev. 6   Vote: I like it 0 Vote: I do not like it

Is anyone at the brink of getting specialist rank (Yes, I am a noob) interested in competing with me on discord? Please check my profile. If you think you are in the same ballpark and would like to actively compete message me either on CF or Discord (username: Anoubhav). I have a server ready with the bot.

Edit 1: If the bot can track the number of wrong submissions before accepted and penalize accordingly (e.g., 10% penalty) that will be more similar to competitions. Also, as mentioned earlier, if the window can be more than 45 mins, that will be more useful for beginners as solving 5 questions will take more time than that.

Edit 2: I have tried it out. It's really awesome!. One more suggestion: As '.match update' keeps track of time, can you also mention the submission times of the participants for accepted solutions? We only receive the following output at the end of the game:
Match over, @ABC has defeated @XYZ
Final score 0 — 600
If we can get the submission times, knowing how close the loser was to getting points adds to the thrill and provides a better summary for the end of the game.

Edit 3: If you can keep track of the previous matches win tally for two users. Something like
Command: '.leaderboard cf-handle-1 cf-handle-2'. Output: 9-12

»
2 months ago, # |
  Vote: I like it +59 Vote: I do not like it

Great! I have a few suggestions:

  1. Maybe instead of changing the first name, it'd be better to submit a compilation error to a given problem? Don't know, it's up for you.

  2. Change "questions" to "problems"/"tasks"!!!

»
2 months ago, # |
  Vote: I like it +82 Vote: I do not like it

Checked. Nice, recommended.

»
2 months ago, # |
Rev. 2   Vote: I like it +8 Vote: I do not like it

Hey, I and sibasish_14 did a match but there was a problem which we had both solved earlier. Can you update it such that it won't show the problems we had solved earlier ?

If you had already implemented something to prevent this, then it might be the error due to the same problem having different index in a Div1 and Div2 contest.

In our case :-
We both had solved https://codeforces.com/contest/1341/problem/D
But the bot put the problem https://codeforces.com/contest/1340/problem/B in the match.

»
2 months ago, # |
Rev. 2   Vote: I like it +5 Vote: I do not like it

I have some suggestion pseudocoder10.

please add some sort of tag filter for problems, for example i'd like the first problem to have tags A, B and C then i want the second problem to not to have tags X, Y and Z.

Also having more freedom on problems' difficulty is appreciated. Also its nice to be able to schedule the competition, change it's length, change the scores and so on. Also being able to set a deadline for each problem sounds interesting (then solving a problem after it's deadline won't give any points).

You can also add $$$1$$$ v.s. $$$1$$$ v.s. $$$1$$$ competition, $$$2$$$ v.s. $$$2$$$ competition and etc. In other words a $$$w_1$$$ v.s. $$$w_2$$$ v.s. $$$\ldots$$$ v.s. $$$w_k$$$ competition.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +17 Vote: I do not like it

    The idea for tag filters for each individual problem sounds a bit overkill for this format, but you can submit an issue for it.

    For the second part, allowing users to set time/number of problems/rating/score distribution is already on the To-Do list.

»
2 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Does .handle identify < username> not work if it's sent by another bot??

I created my own bot to compete with (in nodejs), but I was unable to identify the handle. Although it was working well when any other USER was trying. So, is the identifying disabled for bots??

Well, I did that because I wanted to practice some mixed set of questions rather than competing directly with other users.. Basically competing with, and against myself for the time being.

Please tell me if there's already a way possible to do it. Thanks.

P.s. I don't know much about discord, I was just trying to implement my own thing.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    No, .handle identify wont work with bots. If you really wanna do that, make a discord alt and challenge it.

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I'm doing it that way but I also wanted the .accept challenge thing to be automated. Nvm I'll continue doing it like that, and thanks for the bot!

»
7 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

can many people play at same time

»
2 weeks ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

can more than two people participate in this contest formation?? if yes,then command i should use,please clarify......

  • »
    »
    2 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You can't do that, this bot only supports 1v1 matches. You could probably clone the bot and modify the code to support different formations, though.

    • »
      »
      »
      2 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I have no idea about how to do all this...can u help