Author Topic: Aurel's Adventures  (Read 4349 times)

0 Members and 1 Guest are viewing this topic.

JRS

  • Guest
Aurel's Adventures
« on: June 03, 2015, 10:47:51 PM »
Aurel,

I converted your Josphus problem post on BP.org to Script BASIC.

Code: Script BASIC
  1. ' Josephus problem
  2.  
  3. N = 41
  4. K = 3
  5. S = "The prisoner standing at position %2d is eliminated. %2d prisoner(S) eliminated.\n"
  6.  
  7. for i  = 1 to N
  8.   alive[i] = TRUE
  9. next i
  10.  
  11. eliminated = 0
  12. position = 1
  13. fatal = 1
  14.  
  15. while eliminated < N
  16.   if alive[position] then
  17.    
  18.     if fatal = K then
  19.       alive[position] = FALSE
  20.       eliminated += 1
  21.       print format (S, position, eliminated)
  22.     end if
  23.    
  24.     fatal += 1
  25.     if fatal > K then fatal = 1
  26.   end if
  27.  
  28.   position += 1
  29.   if position > N then position = 1
  30. wend
  31.  


jrs@laptop:~/sb/sb22/test$ scriba josprob.sb
The prisoner standing at position  3 is eliminated.  1 prisoner(S) eliminated.
The prisoner standing at position  6 is eliminated.  2 prisoner(S) eliminated.
The prisoner standing at position  9 is eliminated.  3 prisoner(S) eliminated.
The prisoner standing at position 12 is eliminated.  4 prisoner(S) eliminated.
The prisoner standing at position 15 is eliminated.  5 prisoner(S) eliminated.
The prisoner standing at position 18 is eliminated.  6 prisoner(S) eliminated.
The prisoner standing at position 21 is eliminated.  7 prisoner(S) eliminated.
The prisoner standing at position 24 is eliminated.  8 prisoner(S) eliminated.
The prisoner standing at position 27 is eliminated.  9 prisoner(S) eliminated.
The prisoner standing at position 30 is eliminated. 10 prisoner(S) eliminated.
The prisoner standing at position 33 is eliminated. 11 prisoner(S) eliminated.
The prisoner standing at position 36 is eliminated. 12 prisoner(S) eliminated.
The prisoner standing at position 39 is eliminated. 13 prisoner(S) eliminated.
The prisoner standing at position  1 is eliminated. 14 prisoner(S) eliminated.
The prisoner standing at position  5 is eliminated. 15 prisoner(S) eliminated.
The prisoner standing at position 10 is eliminated. 16 prisoner(S) eliminated.
The prisoner standing at position 14 is eliminated. 17 prisoner(S) eliminated.
The prisoner standing at position 19 is eliminated. 18 prisoner(S) eliminated.
The prisoner standing at position 23 is eliminated. 19 prisoner(S) eliminated.
The prisoner standing at position 28 is eliminated. 20 prisoner(S) eliminated.
The prisoner standing at position 32 is eliminated. 21 prisoner(S) eliminated.
The prisoner standing at position 37 is eliminated. 22 prisoner(S) eliminated.
The prisoner standing at position 41 is eliminated. 23 prisoner(S) eliminated.
The prisoner standing at position  7 is eliminated. 24 prisoner(S) eliminated.
The prisoner standing at position 13 is eliminated. 25 prisoner(S) eliminated.
The prisoner standing at position 20 is eliminated. 26 prisoner(S) eliminated.
The prisoner standing at position 26 is eliminated. 27 prisoner(S) eliminated.
The prisoner standing at position 34 is eliminated. 28 prisoner(S) eliminated.
The prisoner standing at position 40 is eliminated. 29 prisoner(S) eliminated.
The prisoner standing at position  8 is eliminated. 30 prisoner(S) eliminated.
The prisoner standing at position 17 is eliminated. 31 prisoner(S) eliminated.
The prisoner standing at position 29 is eliminated. 32 prisoner(S) eliminated.
The prisoner standing at position 38 is eliminated. 33 prisoner(S) eliminated.
The prisoner standing at position 11 is eliminated. 34 prisoner(S) eliminated.
The prisoner standing at position 25 is eliminated. 35 prisoner(S) eliminated.
The prisoner standing at position  2 is eliminated. 36 prisoner(S) eliminated.
The prisoner standing at position 22 is eliminated. 37 prisoner(S) eliminated.
The prisoner standing at position  4 is eliminated. 38 prisoner(S) eliminated.
The prisoner standing at position 35 is eliminated. 39 prisoner(S) eliminated.
The prisoner standing at position 16 is eliminated. 40 prisoner(S) eliminated.
The prisoner standing at position 31 is eliminated. 41 prisoner(S) eliminated.
jrs@laptop:~/sb/sb22/test$


« Last Edit: June 04, 2015, 08:20:53 AM by John »

Aurel

  • Guest
Re: Aurel's Adventures
« Reply #1 on: June 04, 2015, 07:46:21 AM »
The real adventure is political question:
Is Linux a non-capitalistic OS?
or
Is Windows capitalistic OS?

JRS

  • Guest
Re: Aurel's Adventures
« Reply #2 on: June 04, 2015, 10:42:20 AM »
@Aurel - Do you think we should have to pay for water and air?

JRS

  • Guest
Re: Aurel's Adventures
« Reply #3 on: June 22, 2015, 02:26:03 AM »
For Aurel.


Aurel

  • Guest
Re: Aurel's Adventures
« Reply #4 on: July 26, 2015, 11:10:00 AM »
yes ..i like it..  ;)

Aurel

  • Guest
Re: Aurel's Adventures
« Reply #5 on: November 23, 2015, 11:46:39 AM »
ha adventures....
just look at bp.org ..it looks to me that some real developers must
learn again what is what in windows ...geee  :o

Aurel

  • Guest
Re: Aurel's Adventures
« Reply #6 on: January 07, 2016, 12:33:20 AM »
Hi ..ho...heee....heee
Im back... ;D
This days i must jump over bunch of stupid snow to fix some things.
Also i always forget to thanks our mr.JRS for great image (new logo for my new interpreter  ;D ;D ;D )

Peter

  • Guest
Re: Aurel's Adventures
« Reply #7 on: January 07, 2016, 06:38:21 AM »
Quote
This days i must jump over bunch of stupid snow

You have snow at home !
quickly close all windows before you get a cold.
« Last Edit: January 07, 2016, 06:45:15 AM by Peter »

Aurel

  • Guest
Re: Aurel's Adventures
« Reply #8 on: January 07, 2016, 06:49:30 AM »
Quote
You have snow at home !
almost....
1,5m all over the house ..crap  >:(