Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: An Introduction to General Systems Thinking

by perlmoth (Hermit)
on Sep 25, 2003 at 19:53 UTC ( #294234=note: print w/replies, xml ) Need Help??


in reply to An Introduction to General Systems Thinking

I wrote the following code to implement the OCCULT membership system as outlined in chapter 6:
#!/usr/bin/perl -w use strict; use diagnostics; $|++; my $total = 20; my @members = map int rand 10, (1 .. $total); my @pointers = (" ") x $total; my ($teacher, $pupil); print "@members\n"; for (1 .. 50) { do { $teacher = int rand $total; $pupil = int rand $total; } while $teacher == $pupil; $pointers[ $pupil ] = "V"; $pointers[ $teacher ] = "."; $members[ $pupil ] = ($members[$teacher] * $members[$pupil]) % 10; print "@pointers\n@members\n"; $pointers[ $pupil ] = " "; $pointers[ $teacher ] = " "; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://294234]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2023-01-31 03:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?