Author Topic: Re: Let's play a game, pals.  (Read 3826 times)

worker201

  • Global Moderator
  • Member
  • ***
  • Posts: 2,810
  • Kudos: 703
    • http://www.triple-bypass.net
Re: Let's play a game, pals.
« Reply #15 on: 21 August 2005, 00:41 »
Quote from: solemnwarning
i already posted answer

Except yours only works when n=3.  What if n=8?

I tried Tux's with n=6, and it worked.  Right on!

I really don't have the skills with initializing and populating arrays at this time, so I failed the challenge.  Currently, I am working through the first chapter of K&R, relearning for loops.  The last programming language I used (besides awk and JavaScript) was C++ in '97.  So I kinda have to relearn.

KernelPanic

  • VIP
  • Member
  • ***
  • Posts: 1,878
  • Kudos: 222
Re: Let's play a game, pals.
« Reply #16 on: 21 August 2005, 00:46 »
Quote from: worker201
Except yours only works when n=3.  What if n=8?

I tried Tux's with n=6, and it worked.  Right on!

I really don't have the skills with initializing and populating arrays at this time, so I failed the challenge.  Currently, I am working through the first chapter of K&R, relearning for loops.  The last programming language I used (besides awk and JavaScript) was C++ in '97.  So I kinda have to relearn.


Yup I know how you feel.
I used to do a bit of C++ but now feel absolutely retarded when faced with a problem like this. :(
Time to brush up on things.
Contains scenes of mild peril.

Pathos

  • Member
  • **
  • Posts: 518
  • Kudos: 416
Re: Let's play a game, pals. Challenge 2.
« Reply #17 on: 21 August 2005, 08:42 »
recursion is always the best solution :)

Anyway, in this excerise a recursive solution is pretty much the same as the iterative.

KernelPanic

  • VIP
  • Member
  • ***
  • Posts: 1,878
  • Kudos: 222
Re: Let's play a game, pals. Challenge 2.
« Reply #18 on: 23 August 2005, 01:42 »
I was bored so I edited my script to format the results properly,
again it is kludgy.
Attached as matrix.txt :)


Also, I want one of you fuckers to demonstrate a solution in C/C++ or maybe Pascal so I can learn from it.
Preferably using function recursion but anything is good. :D

[verwijderd door de beheerder]
Contains scenes of mild peril.

worker201

  • Global Moderator
  • Member
  • ***
  • Posts: 2,810
  • Kudos: 703
    • http://www.triple-bypass.net
Re: Let's play a game, pals. Challenge 2.
« Reply #19 on: 23 August 2005, 03:20 »
Nice work, I have verified your correctness using n=8.