Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
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
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Creating a Latin square verifier  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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: 62819
203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Please start by writing down the rules for your square.
 
Abdullah Alieu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.

A N  N Latin square is formally dened 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
Please start by writing down the rules for your square.



A N  N Latin square is formally dened 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: 62819
203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!