• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Problem with Linear Transformation method in Cipher program

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We have to write a cipher program for an assignment. Here's the code for it, it has been documented. The input we are using is {10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160}. The output is meant to be {127,178,145,50,74,59,90,63,36,168,182,106,211,94,8,188} after two rounds. We are not getting the right output and we have determined that the flaw in our program occurs in the linear transformation method (lines 179-213). We've been looking at this program for hours and are having problems finding an error. If someone could take a look at it, we would love them forever!

Here's the code:
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Christina Arsenault:
... We are not getting the right output and we have determined that the flaw in our program occurs in the linear transformation method (lines 179-213)...


How are you testing this method?

In other words, what exactly is the "second part of the linear transformation" supposed to do?
[ October 23, 2007: Message edited by: marc weber ]
 
There are 29 Knuts in one Sickle, and 17 Sickles make up a Galleon. 42 tiny ads in a knut:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic