last day (15 days later) » 

17:45
4
Q: Textbattles KoTH

FireCubezTextbattles Textbattles is is strategy game about, well, text. It consists of a 10x10 grid, where each player has a position on the grid. When it is a player's turn, they can decide whether to move a step in any direction on the grid, or just stay where they are. If a player moves into anothe...

Note that Java string literals are immutable, so returning them takes only a constant number of instructions, no matter how long the literal is.
@user202729 Chances for that to happen are low. And for the avoiding eachother, there will be random events to move people into eachother, I will edit the question.
@user202729 And no, even if Java strings are immutable, it will take time for an algorithm to calculate a random string
Hi FireCubez, and welcome to PPCG! This has the potential to be an interesting challenge, but at the moment it's a bit unclear. In the future, we recommend posting challenges to the sandbox first to work out the details.
"When both players finish guessing, or one of them surrenders, the one with the highest solving penalty is eliminated from the game." Is the solving penalty for immediate surrender zero? Or is surrendering instant elimination? If the latter, what's to prevent while(true) {} in guess?
And what prevents me from returning an arbitrarily long string in generate?
using the hints given to them What hints? The player is supposed to guess the other player's string of arbitrary length? But based on what?
Is this challenge specific to Java? It looks like the player is meant to be implementing an interface. Can you post that interface's definition?
17:45
@Scrooble surrendering is instant elimination, and returning a string that is too long will increase your penalty due to the computing power needed to generate that string
@mypetlion Based on the portion of the string given to them, I know it might seem hard at first, but it's possible with clever thinking (you are allowed to look at others' answers to think about ways to "bypass" them), The interface's description is provided, it's at the part where guess and generate are described
What's stopping us from having a bunch of long strings hardcoded? I could do private static final String mobyDick = 'Call me Ishmael...'; followed by the full text of the novel.
@Mnemonic Thanks for welcoming, I'll be sure to post to the sandbox next time.
@mypetlion People could look at your answer and know.
This discussion is becoming long, and I don't have enough rep to make a chat room, so I can't really answer more questions. I will make a QNA/FAQ at the bottom of the question.
This seems like an interesting question but would probably benefit from being in the sandbox to get some feedback
@Mnemonic for some reason I not able to access meta, I get an error message.
You need to clarify exactly what those "random events" are.
Besides: The KotH, as written, for all existing bots it's possible for me to make a bot that wins the existing one (by using another large text)
Is using Object.hashCode allowed? Note that it's considered random on most implementations (so you may want to disallow it); however IdentityHashMap and other things use it.
17:45
@user202729 anything that's random isn't allowed except getRandom()
What about timing one's code?
@user202729 Timing is done automatically by the game. Unless I don't get what you mean
@FireCubez I love KotHs. I've upvoted this answer, so come and chat with me, and I'll try to help you out in making a solid KotH :)

last day (15 days later) »