[Community Puzzle] MCxxxx microcontroller simulation

Thanks @b0n5a1, I solved my issue.

There is a problem with the statement, it says:

Labels are single words ending with the suffix :

I don’t know what are the possible characters in labels, but I didn’t manage underscores.

With my now working solution, I used the following characters in labels:

  • letters (lower and upper case)
  • digit
  • dash
  • underscore

Sorry, I am a total noob on this topic, but why is the input x0 jumping from 0 to 9 only because it is copying the value to acc and then to dat?
:))
That s my understanding of mov, but I guess I am totally wrong :))

Is there any resurse that explains what actually happen for each instruction, with examples , maybe?

Thank you!

x0 is the input

x0 is used for input, meaning that when the program asks you to take a value from the x0 register you need to take it from the “input data” line.

So, every time you read something from x0 you get a new value.

3
1 2 3
3
mov x0 dat // dat = 1
mov x0 dat // dat = 2
mov x0 dat // dat = 3
1 Like

Hello there ! I’m stuck on the Buffering with dat & acc (Validator) I can’t see my error because all the tests passed nicely, everyone have the same problem ? I’m coding in python…
Thanks.

Here’s the code for the validator

2
2 5
4
mov x0 acc
mov x0 x1
mov acc dat
mov dat x1

As you can see both input values are inveerted before being outputed. There may be an error in your way of managing registers.

1 Like

Forgot to ping you. Look at my message above.

Thanks for the feedback. I fixed the typo and the link does work for me, that’s weird.

1 Like

Thanks for your help, I fixed my code to working 100% !! My error is a missed if statement for dat in first register.
Thank again !

1 Like

This one was really fun! Perhaps my favourite so far!

2 Likes

Thank you <3

Hello i’ve finished the puzzle, all tests passed successfully but after i submited my solution my result is 94%
I encounter a problem with : Digit manipulation II (Validator)

Someone know how to consult the validator ?

Thx :slight_smile:

Here is the validator.

2
321 909
13
mov x0 dat
mov dat acc
dgt 0
mov acc x1
mov dat acc
dgt 1
mov acc x1
mov dat acc
dgt 2
mov acc x1
mov x0 acc
dgt 1
mov acc x1

Output should be

1 2 3 0

Thx for help but this return a Success WTF

@Exanc Even if it is your contribution, it is recommended to not provide validators to users on the forum, but strongly similar ones only (directly inspired by validators wich are issues for users, with very little changes), like I did to help @vpoulailleau. At term if all validators are posted here, hard-coding will just be obvious for anyone, whatever their CodinGame level is.

2 Likes

Because you asked for Digit manipulation II (Validator) and the provided one is in fact Digit manipulation I (Validator) :laughing:.

Try this (it is not the real validator but a very similar one) :

3
0 6 0
9
mov x0 acc
mov x0 dat
dst 1 dat
mov acc x1
mov x0 acc
dst acc dat
dst 2 dat
dst 1 dat
mov acc x1

Expected result :

60 666
4 Likes

Your right. I’ll be more vigilant next time.

Oops, looks like I copied the wrong one :rofl:

Thx bro it work now ! @b0n5a1 :heart_eyes:

With the good validator … @Exanc :sweat_smile:

@Exanc I believe it’s very ok to unlock a stuck member by providing them the missing validator, publicly in the forum.

Hard-coding using validators scattered in forum threads might become obvious, but I doubt it becomes a real issue. I believe the benefit largely compensates the risk here. We can discuss this further in another thread, if you want.

That being said, thanks for the thoughtfulness @b0n5a1 , it’s appreciated

Yeah, I believe myself in the fare play of others an that the purpose of this validator is only to help. But I understand the point of view and I will no longer provide unmodified validators to keep everyone away from the temptations of cheating.

Even if the provided validator will not help with hardcoding since I will never provide the last validator wich requires all the algorithms learned beforehand.