Talk:Number reversal game: Difference between revisions

From Rosetta Code
Content added Content deleted
Line 9: Line 9:
The Python entry is set up to handle this (rare, but still possible), case. Will other entries silently assume the player has won without doing anything? --[[User:Paddy3118|Paddy3118]] 17:21, 17 April 2010 (UTC)
The Python entry is set up to handle this (rare, but still possible), case. Will other entries silently assume the player has won without doing anything? --[[User:Paddy3118|Paddy3118]] 17:21, 17 April 2010 (UTC)
: I don't know about the others, but the BASIC version doesn't check the order until after user input. All the user would have to do is press enter and they'd win with 0 moves, yes. The description and the implementations should be updated IMO; I'll take care of BASIC. -- [[User:Eriksiers|Erik Siers]] 18:56, 17 April 2010 (UTC)
: I don't know about the others, but the BASIC version doesn't check the order until after user input. All the user would have to do is press enter and they'd win with 0 moves, yes. The description and the implementations should be updated IMO; I'll take care of BASIC. -- [[User:Eriksiers|Erik Siers]] 18:56, 17 April 2010 (UTC)

:: Hi, I just saw yet another example added with the same flaw. I could add a note to the task description, but the task description seems to be OK. The problem is a subtle error in a lot of the implementations. I'll mark a few more as incorrect.

Revision as of 02:39, 31 July 2010

This seems to be a variation of what WP calls Pancake sorting. Should the task perhaps be revised somehow? Or perhaps a new "pancake sorting" task be added, and then note this as being applied pancake sorting? -- Eriksiers 20:02, 4 April 2010 (UTC)

Hi Eriksiers, the only restriction on the method of sorting is that only reversals are allowed. It could be that pancake sorting might be a way to get to the desired result, but that algorithm is not mandated. The program does not do a sort. --Paddy3118 20:47, 4 April 2010 (UTC)
What I meant is that I think that it makes the player to perform a pancake sort, kinda... Shrug. It was just a thought. -- Eriksiers 01:38, 5 April 2010 (UTC)
Whoa, I see what you mean though. Maybe a C.f. ? --Paddy3118 05:35, 5 April 2010 (UTC)
What you did looks good to me. I'm too tired right now to give it any more thought tonight. -- Eriksiers 06:37, 5 April 2010 (UTC)

What Happens if the initial shuffle returns the list in sorted order?

The Python entry is set up to handle this (rare, but still possible), case. Will other entries silently assume the player has won without doing anything? --Paddy3118 17:21, 17 April 2010 (UTC)

I don't know about the others, but the BASIC version doesn't check the order until after user input. All the user would have to do is press enter and they'd win with 0 moves, yes. The description and the implementations should be updated IMO; I'll take care of BASIC. -- Erik Siers 18:56, 17 April 2010 (UTC)
Hi, I just saw yet another example added with the same flaw. I could add a note to the task description, but the task description seems to be OK. The problem is a subtle error in a lot of the implementations. I'll mark a few more as incorrect.