About upcoming problems

Back to General discussions forum

Rodion (admin)     2021-03-04 05:20:41
User avatar

Friends, Hi!

I wished to prepare and roll-out 3 new problems simultaneously but while I was testing first of them, at least some of you noticed this in the public log and started trying too.

Well, let it become visible then (I enabled the checker to return "ok" answer so it could be solved now) - I'll write more careful announce a bit later :)

sontran     2021-03-04 05:59:09

Hello there, TestUser. As always, truly appreciate the effort put into this site. Can't wait for new problems to solve. The difficulties are just quite right to be challenging yet entertaining for a beginner like myself, vs Project Euler or CodeForces.

Anyway, sorry to hijact this thread to discuss #223 checker. Seems it still returns strange results. My code works OK for online emulator, but not for checker. Anything special about checker I'm missing here?

Rodion (admin)     2021-03-04 06:05:06
User avatar

My code works OK for online emulator, but not for checker.

I tried it and it looks ok except it won't print the last number (single-digit) - may it be the cause?

UPD: ah, I see, the checker has flaw too giving queer verdict in such case. Going to be fixed in a few minutes, thanks!

sontran     2021-03-04 06:11:12

That did it! Many thanks. The original error message was weird: "Output doesn't start with initial number," when it should have been "it won't print the last number (single-digit)".

Rodion (admin)     2021-03-04 06:18:00
User avatar

when it should have been "it won't print the last number (single-digit)".

Yes, exactly, thanks! Hopefully fixed now...

Ironically the order of checks in this case is such that answer is first checked if it is "completely correct" and only if not, it starts parsing it and check first value etc. So unless you (by our luck) has this small flaw in your code - the issue would remain unnoticed for some more time! :)

gardengnome     2021-03-04 16:07:43
User avatar

This looks like a fun challenge! Maybe some Prolog problems afterwards. :)

One thing: it's not entirely clear what is expected in the answer box (given that there is no test data).

Rodion (admin)     2021-03-04 17:02:15
User avatar

it's not entirely clear

Yep, I noticed you initially had some difficulties with write function and then rewrote the code so it doesn't print output but returns it as string.

I tried to add few phrases to problem statement to elaborate. Hopefully I'll figure out how to clarify similar tasks - and sorry for confusion.

Maybe some Prolog problems afterwards.

The difficulty with Prolog is that while it is praised as being suitable for "logic tasks" - it is usually hard to come up with real logical tasks suitable to be solved with it (imho). Then it is often used in functional or semi-functional style (instead of pure-logical) - but in this regard I'd say Erlang feels quite similar but more mature version of the same :)

But we'll keep an eye on any ideas, for sure!

zelevin     2021-03-04 18:02:42

This is fun; thanks for expanding our (collective) horizons.

I'm confused, however, by the checker returning "Output doesn't end with single-digit value". If I run the same code via scheme.exe (or via tinyscheme-r7), the output certainly ends with the (correct) single-digit value.

Rodion (admin)     2021-03-04 18:44:36
User avatar

I'm confused, however, by the checker returning "Output doesn't end with single-digit value"

Hi! Your case is really confusing at first :)

Try instead of calling say (multiplex 1739) call (begin (multiplex 1739) (newline)) - in the interpreter.

(I'm ready to explain what happens, but you probably would like to figure out what's happening)

Other approach could be - put your code in the file, ending with (multiplex 1739) and run

scheme.exe myfile.sch

I.e. so that it is not in interactive mode.

zelevin     2021-03-04 20:03:12

Thanks for your help!

tomasloksa     2021-03-07 08:59:59

Turns out I ran into the same problem and this helped. Thank you!

Please login and solve 5 problems to be able to post at forum