Win a copy of Programmers Guide to Apache Thrift this week in the Open Source forum!
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
• Campbell Ritchie
• Devaka Cooray
• Knute Snortum
• Paul Clapham
• Tim Cooke
Sheriffs:
• Liutauras Vilda
• Jeanne Boyarsky
• Bear Bibeault
Saloon Keepers:
• Tim Moores
• Stephan van Hulst
• Ron McLeod
• Piet Souris
• Frits Walraven
Bartenders:
• Ganesh Patekar
• Tim Holloway
• salvin francis

# Creating a Latin square verifier

Greenhorn
Posts: 3
Im trying to create a program that take user input and verify if latin square or not. Latin square requirments:  Every row contains the numbers 1 through N exactly once, in any order.
 Every column contains the numbers 1 through N exactly once, in any order.
I have just the code to ask user for numbers but not too sure how to start off verifying .. (Python).. Any help would be appreciated.. thanks

Marshal
Posts: 64473
225
Welcome to the Ranch

Since the logic behind verifying a Latin square/magic square/Sudoku is independent of languages, I shall move you to a different forum.

Abdullah Alieu
Greenhorn
Posts: 3
Thank you.

A N  N Latin square is formally dened by the following criteria:
 Every row contains the numbers 1 through N exactly once, in any order.
 Every column contains the numbers 1 through N exactly once, in any order

Those are the only rules.

Abdullah Alieu
Greenhorn
Posts: 3

Campbell Ritchie wrote:Welcome to the Ranch

Since the logic behind verifying a Latin square/magic square/Sudoku is independent of languages, I shall move you to a different forum.

A N  N Latin square is formally dened by the following criteria:
 Every row contains the numbers 1 through N exactly once, in any order.
 Every column contains the numbers 1 through N exactly once, in any order

Thank you

Campbell Ritchie
Marshal
Posts: 64473
225
So, now describe how you think you can verify that each row N places long contains the numbers1&hellip.N without gaps. The process for columns will be similar, so we shall omit that for the time being.

 If you are using a rototiller, you are doing it wrong. Even on this tiny ad: ScroogeXHTML - small and flexible RTF to HTML converter library https://coderanch.com/t/710903/ScroogeXHTML-RTF-HTML-XHTML-converter