Sudoku Programmers Forum Index

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log inLog in          Games  Calendar

Log in to check your private messagesLog in to check your private messages   

File Formats - you know you want to...

 
Post new topic   Reply to topic    Sudoku Programmers Forum Index -> Programming sudoku
View previous topic :: View next topic  

What's your flavour?
XML is just swell. Plain Text should be hexed.
18%
 18%  [ 2 ]
Plain Text is as good as sex. XML can go to hell.
72%
 72%  [ 8 ]
On my oath I love them both.
9%
 9%  [ 1 ]
Total Votes : 11

Author Message
Agent Allen

Joined: 01 Oct 2005
Posts: 34
:

Items
PostPosted: Fri Oct 07, 2005 9:36 pm    Post subject: File Formats - you know you want to... Reply with quote

Let's discuss file formats.

What are the agreed conventions and where are they documented?

I've gone for an xml format because:

It supports 'exotics' (not 9*9) including n*n and [k*l]*[l*k] where l!=k.
It supports pencil marks.
Supports 'givens' and 'founds' for partially solved puzzles.
I could safely acquire other attributes like difficulty, setter and so on.
I could add regions and support killer sudoku next!

However next thing I'll do is also implement plain text.
Plain-text includes (optional) layout bars and so on...
It appears it can't do exotics but can probably be persuaded to do the rest.

Any thoughts or formal specifications anyone?

Who about an dtd or xsd you know and love? Wink
_________________
Agent A
Back to top
View user's profile Send private message
Ruud
Site Admin
Joined: 17 Sep 2005
Posts: 708
:
Location: Netherlands

Items
PostPosted: Fri Oct 07, 2005 10:36 pm    Post subject: Reply with quote

Yes, I do think both are fine!

Currently, I use plain text with a '#' preceding lines that I use for a special purpose, such as a partial solution, comments, author, date, source (newspaper or website), difficulty and solving tips.

For these, equivalent elements in XML would be a requirement for me.

Since we ARE at a Sudoku programmers forum here, this would be the right place to come up with some standard file formats.

Format 1: Sudoku definition, containing:
- name or description
- author
- puzzle size, symbols & constraints (either predefined code or full definition)
- date
- publisher
- copyright notice (to be ignored by who don't believe in it)
- difficulty level (either coded, a numerical rating, or "par" minutes)
- solution tips
- clues
- program-specific features (like SYSEX in a standard MIDI file)

the file must be capable of containing a single puzzle or multiple puzzles in a "book"

Format 2: Partially solved Sudoku, containing
- Reference to a Sudoku definition (file name [+ book index])
- filled cells (with digit color)
- (pencil)marks
- cell colors
- mark colors
- cursor position
- digits selected for special features (filter/highlight, eliminations)
- program-specific features (like SYSEX in a standard MIDI file)

I would be quite happy if we could standardize this. Plain text or XML is not an issue for me.
Back to top
View user's profile Send private message Visit poster's website
Agent Allen

Joined: 01 Oct 2005
Posts: 34
:

Items
PostPosted: Sun Oct 09, 2005 8:26 pm    Post subject: XML would suit you sir Reply with quote

Ruud,

If you're interested in all those additional attributes, XML would suit you more than text.
It's far easier to define optional extensions in XML than text formats.
You can even define processing instructions which sound like the SYSEX you're looking for...

The criticism of comments has always been that their informal format doesn't lend itself to them being processed.
It's hard for a filing system to show file properties unless they've got a formal location and/or signage to know where they are...

I started this topic partly to see if there was a standard (or standardising) format for text.
I think I want to code one because its easier to lift puzzles from forums with a plain text interpreter, but I was thinking nice and simple.

For example, does anyone deal with 'exotic' puzzles (i.e. aren't (3x3)x(3x3)) in text?
_________________
Agent A
Back to top
View user's profile Send private message
dukuso

Joined: 14 Jul 2005
Posts: 424
:
Location: germany

Items
PostPosted: Mon Oct 10, 2005 5:41 am    Post subject: Reply with quote

xml means, that you do have to have Exell installed
to open it ?
That's a strange requirement.
Please note also that there are already existing
conventions on file formats containing
QCP,QWH instances which are almost the same
as sudokus without the blocks-constraint.

Most common seems to be "DIMACS" format.
But this is not very suitable, they generate a large graph and
then color it.
A sudoku is also a constraint satisfaction problem
and there are also standardised formats to store these.
There should be an utility to convert between all these formats
rather than an attempt to unify them, which is not possible IMO.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Ruud
Site Admin
Joined: 17 Sep 2005
Posts: 708
:
Location: Netherlands

Items
PostPosted: Mon Oct 10, 2005 8:21 am    Post subject: Reply with quote

dukuso wrote:
xml means, that you do have to have Exell installed
to open it?


erm... no

xml=eXtended Markup Language, an extension to HTML that deals with the exchange of structured data between applications, web services and clients, etc.

xls=a file extension used by MS Excel

Most Sudoku programs (mine certainly does) allow copy and paste in text format. That would be sufficient to post and pick Sudokus on forums like these. In a file on disk we might want a little bit more info than just the clues.
Back to top
View user's profile Send private message Visit poster's website
Lardarse

Joined: 06 Sep 2005
Posts: 11
:
Location: Bristol, UK

Items
PostPosted: Wed Oct 12, 2005 2:21 am    Post subject: Reply with quote

I think that plain text is fine for a 9x9 puzzle, but I think that the basig 9x9 puzzle has been done to death now. For more interesting puzzles (Samunampure, geometric, NxN, multiple grids, relays, the list goes on and on...) then XML would be needed.

LA

PS: Feel free to ask is you need any of those different types explained to you...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Sudoku Programmers Forum Index -> Programming sudoku All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Sudoku Programmers topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group

Igloo Theme Version 1.0 :: Created By: Andrew Charron