* Monte Carlo Simulation in GPSS with Counters
SIMULATE
GENERATE
1 * Generate one entity at a
time with no delay
TRANSFER .5, SUCCEED, FAIL * 50% chance of success, else fail
SUCCEED ADVANCE 1 * Delay for successful trials
COUNT SUCCESS * Increment SUCCESS counter
TERMINATE 1 * End successful entity
FAIL ADVANCE 1 * Delay for failed trials
COUNT FAILURE * Increment FAILURE counter
TERMINATE 1 * End failed entity
START 10 * Start the simulation with 10 entities
END
KiBNb250ZSBDYXJsbyBTaW11bGF0aW9uIGluIEdQU1Mgd2l0aCBDb3VudGVycwoKU0lNVUxBVEUKR0VORVJBVEUgMSAgICAgICAgICAgICAgICAgICogR2VuZXJhdGUgb25lIGVudGl0eSBhdCBhIHRpbWUgd2l0aCBubyBkZWxheQoKICAgICAgICBUUkFOU0ZFUiAuNSwgU1VDQ0VFRCwgRkFJTCAgICogNTAlIGNoYW5jZSBvZiBzdWNjZXNzLCBlbHNlIGZhaWwKClNVQ0NFRUQgQURWQU5DRSAxICAgICAgICAgICAqIERlbGF5IGZvciBzdWNjZXNzZnVsIHRyaWFscwogICAgICAgIENPVU5UIFNVQ0NFU1MgICAgICAgKiBJbmNyZW1lbnQgU1VDQ0VTUyBjb3VudGVyCiAgICAgICAgVEVSTUlOQVRFIDEgICAgICAgICAqIEVuZCBzdWNjZXNzZnVsIGVudGl0eQoKRkFJTCAgICBBRFZBTkNFIDEgICAgICAgICAgICogRGVsYXkgZm9yIGZhaWxlZCB0cmlhbHMKICAgICAgICBDT1VOVCBGQUlMVVJFICAgICAgICogSW5jcmVtZW50IEZBSUxVUkUgY291bnRlcgogICAgICAgIFRFUk1JTkFURSAxICAgICAgICAgKiBFbmQgZmFpbGVkIGVudGl0eQoKU1RBUlQgMTAgICAgICAgICAgICAgICAgICAgICogU3RhcnQgdGhlIHNpbXVsYXRpb24gd2l0aCAxMCBlbnRpdGllcwpFTkQ=