Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

Minecraft 1.10.x, (削除) 924 (削除ここまで) 512 bytes

Thanks to @quat quat for reducing the blytecount by 48 points and the bytecount by 412.

Alright, so, I took some of the ideas from this answer this answer and made a version of my own, except that this one is capable of accepting non-negative input. A version may be found here in structure block format.

group

(new version looks kinda boring tbh)

Similar commands as the other answer:

scoreboard objectives add a dummy
execute @e[type=Pig] ~ ~ ~ scoreboard players add m a 1
execute @e[type=Cow] ~ ~ ~ scoreboard players add n a 1
scoreboard players operation n a += m a
tellraw @a {"score":{"name":"n","objective":"a"}}

To input numbers, spawn in a number of cows and pigs. Cows will represent value "n" and pigs will represent value "m". The command block system will progressively kill the cows and pigs and assign values as necessary.

This answer assumes that you are in a world with no naturally occurring cows or pigs and that the values stored in "n" and "m" are cleared on each run.

Minecraft 1.10.x, (削除) 924 (削除ここまで) 512 bytes

Thanks to @quat for reducing the blytecount by 48 points and the bytecount by 412.

Alright, so, I took some of the ideas from this answer and made a version of my own, except that this one is capable of accepting non-negative input. A version may be found here in structure block format.

group

(new version looks kinda boring tbh)

Similar commands as the other answer:

scoreboard objectives add a dummy
execute @e[type=Pig] ~ ~ ~ scoreboard players add m a 1
execute @e[type=Cow] ~ ~ ~ scoreboard players add n a 1
scoreboard players operation n a += m a
tellraw @a {"score":{"name":"n","objective":"a"}}

To input numbers, spawn in a number of cows and pigs. Cows will represent value "n" and pigs will represent value "m". The command block system will progressively kill the cows and pigs and assign values as necessary.

This answer assumes that you are in a world with no naturally occurring cows or pigs and that the values stored in "n" and "m" are cleared on each run.

Minecraft 1.10.x, (削除) 924 (削除ここまで) 512 bytes

Thanks to @quat for reducing the blytecount by 48 points and the bytecount by 412.

Alright, so, I took some of the ideas from this answer and made a version of my own, except that this one is capable of accepting non-negative input. A version may be found here in structure block format.

group

(new version looks kinda boring tbh)

Similar commands as the other answer:

scoreboard objectives add a dummy
execute @e[type=Pig] ~ ~ ~ scoreboard players add m a 1
execute @e[type=Cow] ~ ~ ~ scoreboard players add n a 1
scoreboard players operation n a += m a
tellraw @a {"score":{"name":"n","objective":"a"}}

To input numbers, spawn in a number of cows and pigs. Cows will represent value "n" and pigs will represent value "m". The command block system will progressively kill the cows and pigs and assign values as necessary.

This answer assumes that you are in a world with no naturally occurring cows or pigs and that the values stored in "n" and "m" are cleared on each run.

deleted 96 characters in body
Source Link
Addison Crump
  • 11.3k
  • 1
  • 45
  • 91

Minecraft 1.10.x, (削除) 248 (削除ここまで) 200 blytes or (削除) 924 (削除ここまで) 512 structure block bytes

Thanks to @quat for reducing the blytecount by 48 points and the bytecount by 412.

Alright, so, I took some of the ideas from this answer and made a version of my own, except that this one is capable of accepting non-negative input. A version may be found here in structure block format.

group

(new version looks kinda boring tbh)

Similar commands as the other answer:

scoreboard objectives add a dummy
execute @e[type=Pig] ~ ~ ~ scoreboard players add m a 1
execute @e[type=Cow] ~ ~ ~ scoreboard players add n a 1
scoreboard players operation n a += m a
tellraw @a {"score":{"name":"n","objective":"a"}}

To input numbers, spawn in a number of cows and pigs. Cows will represent value "n" and pigs will represent value "m". The command block system will progressively kill the cows and pigs and assign values as necessary.

This answer assumes that you are in a world with no naturally occurring cows or pigs and that the values stored in "n" and "m" are cleared on each run.

Minecraft 1.10.x, (削除) 248 (削除ここまで) 200 blytes or (削除) 924 (削除ここまで) 512 structure block bytes

Thanks to @quat for reducing the blytecount by 48 points and the bytecount by 412.

Alright, so, I took some of the ideas from this answer and made a version of my own, except that this one is capable of accepting non-negative input. A version may be found here in structure block format.

group

(new version looks kinda boring tbh)

Similar commands as the other answer:

scoreboard objectives add a dummy
execute @e[type=Pig] ~ ~ ~ scoreboard players add m a 1
execute @e[type=Cow] ~ ~ ~ scoreboard players add n a 1
scoreboard players operation n a += m a
tellraw @a {"score":{"name":"n","objective":"a"}}

To input numbers, spawn in a number of cows and pigs. Cows will represent value "n" and pigs will represent value "m". The command block system will progressively kill the cows and pigs and assign values as necessary.

This answer assumes that you are in a world with no naturally occurring cows or pigs and that the values stored in "n" and "m" are cleared on each run.

Minecraft 1.10.x, (削除) 924 (削除ここまで) 512 bytes

Thanks to @quat for reducing the blytecount by 48 points and the bytecount by 412.

Alright, so, I took some of the ideas from this answer and made a version of my own, except that this one is capable of accepting non-negative input. A version may be found here in structure block format.

group

(new version looks kinda boring tbh)

Similar commands as the other answer:

scoreboard objectives add a dummy
execute @e[type=Pig] ~ ~ ~ scoreboard players add m a 1
execute @e[type=Cow] ~ ~ ~ scoreboard players add n a 1
scoreboard players operation n a += m a
tellraw @a {"score":{"name":"n","objective":"a"}}

To input numbers, spawn in a number of cows and pigs. Cows will represent value "n" and pigs will represent value "m". The command block system will progressively kill the cows and pigs and assign values as necessary.

This answer assumes that you are in a world with no naturally occurring cows or pigs and that the values stored in "n" and "m" are cleared on each run.

added 204 characters in body
Source Link
Addison Crump
  • 11.3k
  • 1
  • 45
  • 91

Minecraft 1.10.x, 248(削除) 248 (削除ここまで) 200 blytes or 924(削除) 924 (削除ここまで) 512 structure block bytes

Thanks to @quat for reducing the blytecount by 48 points and the bytecount by 412.

Alright, so, I took some of the ideas from this answer and made a version of my own, except that this one is capable of accepting non-negative input. A version may be found here in structure block format.

group group

(new version looks kinda boring tbh)

Similar commands as the other answer:

scoreboard objectives add a dummy
killexecute @e[type=Cow,c=1]
kill@e[type=Pig] @e[type=Pig,c=1]
~ ~ ~ scoreboard players add m a 1
execute @e[type=Cow] ~ ~ ~ scoreboard players add n a 1
scoreboard players operation n a += m a
tellraw @a {"score":{"name":"n","objective":"a"}}

To input numbers, spawn in a number of cows and pigs. Cows will represent value "n" and pigs will represent value "m". The command block system will progressively kill the cows and pigs and assign values as necessary.

This answer assumes that you are in a world with no naturally occurring cows or pigs and that the values stored in "n" and "m" are cleared on each run.

Minecraft 1.10.x, 248 blytes or 924 structure block bytes

Alright, so, I took some of the ideas from this answer and made a version of my own, except that this one is capable of accepting non-negative input. A version may be found here in structure block format.

group

Similar commands as the other answer:

scoreboard objectives add a dummy
kill @e[type=Cow,c=1]
kill @e[type=Pig,c=1]
scoreboard players add m a 1
scoreboard players add n a 1
scoreboard players operation n a += m a
tellraw @a {"score":{"name":"n","objective":"a"}}

To input numbers, spawn in a number of cows and pigs. Cows will represent value "n" and pigs will represent value "m". The command block system will progressively kill the cows and pigs and assign values as necessary.

This answer assumes that you are in a world with no naturally occurring cows or pigs and that the values stored in "n" and "m" are cleared on each run.

Minecraft 1.10.x, (削除) 248 (削除ここまで) 200 blytes or (削除) 924 (削除ここまで) 512 structure block bytes

Thanks to @quat for reducing the blytecount by 48 points and the bytecount by 412.

Alright, so, I took some of the ideas from this answer and made a version of my own, except that this one is capable of accepting non-negative input. A version may be found here in structure block format.

group

(new version looks kinda boring tbh)

Similar commands as the other answer:

scoreboard objectives add a dummy
execute @e[type=Pig] ~ ~ ~ scoreboard players add m a 1
execute @e[type=Cow] ~ ~ ~ scoreboard players add n a 1
scoreboard players operation n a += m a
tellraw @a {"score":{"name":"n","objective":"a"}}

To input numbers, spawn in a number of cows and pigs. Cows will represent value "n" and pigs will represent value "m". The command block system will progressively kill the cows and pigs and assign values as necessary.

This answer assumes that you are in a world with no naturally occurring cows or pigs and that the values stored in "n" and "m" are cleared on each run.

deleted 27 characters in body
Source Link
Addison Crump
  • 11.3k
  • 1
  • 45
  • 91
Loading
Source Link
Addison Crump
  • 11.3k
  • 1
  • 45
  • 91
Loading

AltStyle によって変換されたページ (->オリジナル) /