Click here to Skip to main content
15,888,454 members
Home / Discussions / Algorithms
   

Algorithms

 
QuestionRomanization of Japanese using the Hepburn (or related - like ISO_3602) algorithm Pin
Tom Clement30-Dec-09 14:40
professionalTom Clement30-Dec-09 14:40 
AnswerRe: Romanization of Japanese using the Hepburn (or related - like ISO_3602) algorithm Pin
ProtoBytes27-Jan-10 7:20
ProtoBytes27-Jan-10 7:20 
QuestionSnake game problem Pin
venomation28-Dec-09 11:03
venomation28-Dec-09 11:03 
AnswerRe: Snake game problem [modified] Pin
Luc Pattyn28-Dec-09 11:33
sitebuilderLuc Pattyn28-Dec-09 11:33 
AnswerRe: Snake game problem Pin
Skippums13-Jan-10 10:58
Skippums13-Jan-10 10:58 
GeneralRe: Snake game problem Pin
Luc Pattyn13-Jan-10 11:30
sitebuilderLuc Pattyn13-Jan-10 11:30 
GeneralRe: Snake game problem Pin
Skippums13-Jan-10 13:36
Skippums13-Jan-10 13:36 
GeneralRe: Snake game problem Pin
Luc Pattyn13-Jan-10 13:56
sitebuilderLuc Pattyn13-Jan-10 13:56 
I think you misunderstood my proposal; I'm not reworking the whole snake on each step of its journey: I add a head (like you do), and I replace the current tail by the cell that is numbered one higher, so if a snake is 1-2-3-4 at one point in time, it is 2-3-4-5 the next, etc. So it is as O(1) as yours, and has a similar limitation as I must end the game, or do something very special, when the head would overflow (an easy trick would be to use odd values only for the snake cells, i.e. increment by 2; that would work fine except for very complex paths on huge boards).


BTW:
Skippums wrote:
there are still three states: empty=int.MaxValue, new_section=int.MaxValue - 1, and other=moveCount % (int.MaxValue - 1)

if the state variable can range from 0 to int.MaxValue, few people would call that three states Laugh | :laugh:

Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

Happy New Year to all.
We hope 2010 soon brings us automatic PRE tags!
Until then, please insert them manually.


GeneralRe: Snake game problem Pin
Skippums13-Jan-10 14:22
Skippums13-Jan-10 14:22 
GeneralRe: Snake game problem Pin
Luc Pattyn13-Jan-10 14:40
sitebuilderLuc Pattyn13-Jan-10 14:40 
AnswerRe: Snake game problem Pin
pewtas23-Feb-10 20:16
pewtas23-Feb-10 20:16 
GeneralRe: Snake game problem Pin
venomation4-Mar-10 1:25
venomation4-Mar-10 1:25 
QuestionGeometry problem Pin
Daniel.Sturza27-Dec-09 3:03
Daniel.Sturza27-Dec-09 3:03 
AnswerRe: Geometry problem Pin
Luc Pattyn27-Dec-09 3:10
sitebuilderLuc Pattyn27-Dec-09 3:10 
GeneralRe: Geometry problem [modified] Pin
Daniel.Sturza27-Dec-09 3:45
Daniel.Sturza27-Dec-09 3:45 
AnswerRe: Geometry problem Pin
harold aptroot27-Dec-09 4:33
harold aptroot27-Dec-09 4:33 
GeneralRe: Geometry problem Pin
Daniel.Sturza27-Dec-09 5:31
Daniel.Sturza27-Dec-09 5:31 
AnswerRe: Geometry problem Pin
Luc Pattyn27-Dec-09 5:28
sitebuilderLuc Pattyn27-Dec-09 5:28 
GeneralRe: Geometry problem Pin
Daniel.Sturza27-Dec-09 5:52
Daniel.Sturza27-Dec-09 5:52 
GeneralRe: Geometry problem Pin
Luc Pattyn27-Dec-09 6:10
sitebuilderLuc Pattyn27-Dec-09 6:10 
GeneralRe: Geometry problem Pin
Daniel.Sturza27-Dec-09 7:13
Daniel.Sturza27-Dec-09 7:13 
AnswerRe: Geometry problem Pin
ProtoBytes28-Dec-09 6:21
ProtoBytes28-Dec-09 6:21 
AnswerRe: Geometry problem [modified] Pin
ProtoBytes28-Dec-09 9:05
ProtoBytes28-Dec-09 9:05 
GeneralRe: Geometry problem Pin
Daniel.Sturza28-Dec-09 16:06
Daniel.Sturza28-Dec-09 16:06 
GeneralRe: Geometry problem Pin
belzu29-Dec-09 4:52
belzu29-Dec-09 4:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.