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

Algorithms

 
AnswerRe: Complexity help please! Pin
ProtoBytes27-Jan-10 7:24
ProtoBytes27-Jan-10 7:24 
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 
Ah... then perhaps there are still three states: empty=int.MaxValue, new_section=int.MaxValue - 1, and other=moveCount % (int.MaxValue - 1) (if it is not possible to have a game where int.MaxValue - 1 moves are made, then forget the modulus to save time. Also be sure that grid_height * grid_width < int.MaxValue - 1). Basically, I was trying to suggest the possibility that the number assigned to each cell was not necessarily the location of that cell in the snake. This allows a move to be performed in O(1) time instead of having to iterate through each snake segment and decrement it to reflect the snake segment on that tile. I think you were suggesting the same thing, but after reading your post I didn't know if that was clear to the OP or not, so I tried to expound upon it even though I probably just added to the confusion with my buggy approach. Thanks for the catch!

Sounds like somebody's got a case of the Mondays

-Jeff

GeneralRe: Snake game problem Pin
Luc Pattyn13-Jan-10 13:56
sitebuilderLuc Pattyn13-Jan-10 13:56 
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 

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.