8
\$\begingroup\$

Seeing as how we've discussed a size measurement for Minecraft redstone creations, I thought I'd follow that up with establishing standard output and input methods.

Minecraft, obviously, does not have STDIN or STDOUT in the traditional sense. So how exactly should we handle input and output for Minecraft redstone "programs?" What methods should be considered standard?

\$\endgroup\$
14
  • \$\begingroup\$ You could output with "/say " \$\endgroup\$
    – Alien G
    Nov 16, 2015 at 3:16
  • \$\begingroup\$ Is this asking about pure redstone or redstone+command blocks or both? \$\endgroup\$ Nov 16, 2015 at 3:28
  • \$\begingroup\$ @Calvin'sHobbies Both. \$\endgroup\$ Nov 16, 2015 at 4:16
  • \$\begingroup\$ The meta question you link failed to establish an objective size measurement. \$\endgroup\$
    – feersum
    Nov 16, 2015 at 18:40
  • \$\begingroup\$ @feersum I believe it has. This answer has been accepted, and several answers have been made with these rules. \$\endgroup\$ Nov 16, 2015 at 18:43
  • 2
    \$\begingroup\$ @quartata That answer is bogus. It provides no way to decode a sequence of bytes into an assembly of Minecraft blocks, or vice versa. \$\endgroup\$
    – feersum
    Nov 16, 2015 at 18:48
  • \$\begingroup\$ @feersum By this reasoning, we should have a textual representation for Piet. \$\endgroup\$ Nov 16, 2015 at 18:49
  • 1
    \$\begingroup\$ @feersum I have seen no Piet program scored in this manner. The accepted standard, as far as I know, is by codels. \$\endgroup\$ Nov 16, 2015 at 18:52
  • \$\begingroup\$ @feersum Let's move this to The Nineteenth Byte. \$\endgroup\$ Nov 16, 2015 at 18:53
  • \$\begingroup\$ Indeed, I don't think any Piet program could be scored like that, since even the raw image format contains headers and metadata. \$\endgroup\$ Nov 16, 2015 at 18:53
  • 1
    \$\begingroup\$ @quartata, the "is accepted" property is almost entirely irrelevant on meta questions which are trying to establish a community consensus. The only thing it tells you is that OP preferred that answer. +10/-7 doesn't look like a real consensus. \$\endgroup\$ Nov 16, 2015 at 23:24
  • \$\begingroup\$ @PeterTaylor Wait, it had 7 downvotes? \$\endgroup\$ Nov 17, 2015 at 0:07
  • \$\begingroup\$ I was not aware of this at all. My bad. \$\endgroup\$ Nov 17, 2015 at 0:08
  • \$\begingroup\$ Can anyone think of a situation where button input would be useful over lever input? Perhaps to start/halt execution? \$\endgroup\$
    – mbomb007
    Nov 21, 2015 at 18:31

4 Answers 4

10
\$\begingroup\$

Output using /say or /tellraw in a Command Block

This is probably the most obvious output method, since it outputs as text to chat. As a bonus, /say (but not /tellraw) would also output to "real" STDOUT on a server.

Since /say outputs a [@] before the text, we should probably use similar rules to this to determine when /say is allowed (as opposed to /tellraw).

\$\endgroup\$
5
  • \$\begingroup\$ It actually doesn't output tellraw to STDOUT, as it doesn't identify it as a user. Only /say will output to the command line, as the @ player does the /say command. \$\endgroup\$ Nov 16, 2015 at 18:37
  • \$\begingroup\$ Oh, I didn't know that. \$\endgroup\$ Nov 16, 2015 at 18:37
  • \$\begingroup\$ Another problem - all /say is prepended with [@] (note the space), so, depending on the OPs choice, it may not be valid output. In the chat log, it's prepended with [current time] [@] . \$\endgroup\$ Nov 16, 2015 at 18:40
  • \$\begingroup\$ You can do /gamerule CommandBlockOutput false or something like that, though that is a byte-waster. Perhaps this can be an assumed state? \$\endgroup\$ Nov 16, 2015 at 18:44
  • \$\begingroup\$ @CᴏɴᴏʀO'Bʀɪᴇɴ Won't solve it - the [@] is still the player that executes /say. \$\endgroup\$ Nov 16, 2015 at 18:44
7
\$\begingroup\$

Alternate Output with Redstone Lamps

Consider a pure redstone mechanism. Using a Command Block would eat a good deal of bytes; I agree that, when explicitly said, STDOUT is what quartata suggested in his answer. When otherwise not stated, it may be easier to output using Redstone Lamps, if all you need to output is a truthy/fasly value. Thus, an on-state redstone lamp could be truthy, and an off-state could be a falsy value.

\$\endgroup\$
2
  • 2
    \$\begingroup\$ As an extension to this, a sequence lamps used together could possibly be used for binary numeric output. \$\endgroup\$ Nov 20, 2015 at 21:42
  • \$\begingroup\$ @dohaqatar7 Like if a question asks to write a function xor-ing two bytes together, for example, then you have 16 levers for input, 8 lamps for output. \$\endgroup\$
    – mbomb007
    Nov 21, 2015 at 18:24
7
\$\begingroup\$

Binary input with levers on blocks

This is the obvious, simple solution for pure-redstone answers. Encode the input into binary, and input it with levers. Bit order (most significant first or least significant first) and the translation between bits and lever positions (e.g. 0 = up, 1 = down, or vice-versa) would be individually specified by the answer. Since levers can only be placed on the sides of blocks, a free (as in, not counting towards the score of the program) block with a single lever mounted on it for each bit of input seems appropriate.

\$\endgroup\$
3
\$\begingroup\$

String Input, via tellraw

So it actually is possible to get textual input in minecraft, though you couldnt do much with it. WARNING: THE FOLLOWING IS COMPLEX.

Lets start with the actual string input. This can be achieved through a simple keyboard tellraw command (like the one in this video). Each key can be linked to a trigger objective where the key determines the value of the score in that objective. Command blocks would then determine what key it is, and summon an entity with that name at a certain position. The system would then detect an entity there, and move it over by one block. This repeats, moving each entity over by one block until a row of "character" entities is made. Next, to use this information, you can issue specific testfors and executes to determine the string. enter image description here In this case, a command could be /execute @e[0,0,0,r=0,type=Chicken,name=A] ~ ~ ~1 execute @e[r=0,type=Chicken,name=B] ~ ~ ~1 execute @e[r=0,type=Chicken,name=e] ~ ~ ~1 execute @e[r=0,type=Chicken,name=2] ~ ~ ~ say TRUE, for example.

TLDR

Create a tellraw keyboard that spawns in an entity chain, adding to the chain in each click, and perform execute commands to test string qualities.

Note: If this answer gets enough votes I will make a fully working example system to prove this concept.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ That's... cool. Wow. \$\endgroup\$ Nov 18, 2015 at 4:10
  • 1
    \$\begingroup\$ @CᴏɴᴏʀO'Bʀɪᴇɴ I made a whole adventure map with this concept once... too bad it has been lost with time or else I would of included it. Oh well. \$\endgroup\$
    – GamrCorps
    Nov 18, 2015 at 4:11
  • 1
    \$\begingroup\$ You could use Sethbling's typewriter but change the commands to do this instead. \$\endgroup\$
    – DanTheMan
    Nov 18, 2015 at 17:16
  • 2
    \$\begingroup\$ Ewww. I think I prefer the hard coded idea better, as input in MC shouldn't be this complicated. Plus, this isn't really input, per say, but testing if the string is existent. \$\endgroup\$ Nov 18, 2015 at 21:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .