Take input in NodeJS [ For all Online Judges ]

Thank you @Nusab19 for this post. It is really useful.

I think it also makes sense to add D8 as another language option under the JavaScript group. I will look into it in sha Allah. Thank you @touhidurrr for suggesting this.

2 Likes

Toph now supports d8 as a programming language, experimentally.

1 Like

Wow!
I just wonder how quickly you added D8.

Thanks a lot for this! <3

1 Like

I can show you a little summary of the commit that got the feature in:

image

This is Go code. Out of the 15 lines added, 4 of them are } and 1 one of them is an empty line. :slightly_smiling_face:

1 Like

haha. You made it seem too easy :3

I have another feature request. :slight_smile:
In addition to being able to give stars to someone’s post, it would be very useful to have the option to react with emojis. This is not a high-priority request, but it would make it easier to express emotions using emojis.

1 Like

Just tried it @hjr265 @Nusab19 and it does look like quite fun.
Coding in d8 feels like Python but more fun as JS syntax is more free.
Here is a submission that I made:

const [a, b] = readline().split(' ').map(e => +e);
console.log(a + b);
1 Like

However it looks like the editor is not remembering my last selected language @hjr265. Might be a bug.

Also, it looks like all inputs should end with a newline character. readline() fails for certain problems such as:

1 Like

That, unfortunately, is a limitation of readline in d8.

But at the same time we want to have LFs for each line in test case inputs and outputs. If you think a problem is lacking that, please raise it in the corresponding discussion topic for that problem.

@Nusab19 Done

1 Like

https://community.toph.co/t/many-problems-inputs-not-ending-with-a-newline/

1 Like

In, https://toph.co/settings/problem_archive
There’s an option to select a default language.
It works only for file submission, not for the editor.

During contest, it becomes a bit annoying to scroll and select the language each time. Might be a bug.

p.s: Thanks a lot for the reaction update! It’s great!

Finally, someone came along and made our suffering a little easier. <3

2 Likes

Welcome to Toph Community bruh. One thing you can do is sharing your suffering with the community whenever you want. You will never know how many people have suffered like you before if you do not share it.
And make sure to have fun !!!

2 Likes

I am suffering a lot due to light mode. Is it such a difficult task to implement dark mode? A few lines of CSS do the job, right?

2 Likes

What do you think @Nusab19 ?

Maybe open a new topic on this on feature

Ok, maybe looks like there is already a topic on this. Maybe re-vitalize it?

Exactly. But pitch dark will also hurt eyes. Maybe theme like dracula’s black will be nice

1 Like

I like github dark default and dark diamond.

@hjr265 the d8 version added is too old. version 9.0 was released on March 17, 2021.

Doesn’t even support destructuring.