Thread: Josephus problem

  1. #1
    Unregistered
    Guest

    Lightbulb Josephus problem

    I am having trouble on how to write a Josephus program.... could someone send me the josephus program in C too [email protected] I would be very thankful.

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    162
    What exactly is a Josephus program?

  3. #3
    Registered User ski6ski's Avatar
    Join Date
    Aug 2001
    Posts
    133
    My brother Josephus wrote a program once.
    C++ Is Powerful
    I use C++
    There fore I am Powerful

  4. #4
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    Make sure you have read this...

    http://www.cprogramming.com/cboard/a...p?s=&forumid=3

    ...but I, too, am curious about what it actually is.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  5. #5
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    There's an algorithm here. If you can't convert it to C, doing a search on google might help.
    zen

  6. #6
    Unregistered
    Guest

    Question

    I was reading the reccomended site and wondered what does @ do? By the way, what language was that in?

  7. #7
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459
    i'm guessing it's pascal, it looked a lot like basic though... and it's not that hard to follow so you can plug it in yourself...
    hasafraggin shizigishin oppashigger...

  8. #8
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Must be pascal. Gosub *v(1,2,3) is not valid in BASIC. It would have to be changed to gosub 40 or another valid line number.

    There are no official pointers in BASIC. You can do them, but it is not at all like C or PASCAL. The * character in BASIC means multiply and nothing else. This codes also looks a bit strange to even be Pascal, though.

  9. #9
    Registered User kitten's Avatar
    Join Date
    Aug 2001
    Posts
    109
    It's definately not pascal code. I've written pascal some 5 years ago. Pascal's more C-like language.
    Making error is human, but for messing things thoroughly it takes a computer

  10. #10
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    It's UBasic. Don't know what it means though, probably Ugly-Basic or something PASCAL looks waaaaaaay more structured.


    Edited to add:

    I am having trouble with girls.... could someone send me the girl of my dreams to nvoigt@... I would be very thankful.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  11. #11
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    @ is the remainder after integer division operator, (like our %).

    http://www.math.utk.edu/~husch/401-9...c/ubhelp1.html
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  12. #12
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459
    oh okay, well i was close! same thing! basik, pascal, fortran, cobol...it's all a blur (whizz!!!!) to me...
    hasafraggin shizigishin oppashigger...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  2. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  3. Please , i need help with this Josephus Problem
    By Haytham in forum C Programming
    Replies: 17
    Last Post: 04-07-2007, 07:28 PM
  4. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 06:24 PM
  5. The Josephus Problem
    By Nakeerb in forum C++ Programming
    Replies: 5
    Last Post: 11-21-2002, 08:43 AM