Download code

Jump to: navigation, search

Back to Hello_World_(occam)

Download for Windows: zip

Download for UNIX: zip, tar.gz, tar.bz2

build_and_run-kroc.sh

 1 #!/bin/bash
 2 # The authors of this work have released all rights to it and placed it
 3 # in the public domain under the Creative Commons CC0 1.0 waiver
 4 # (http://creativecommons.org/publicdomain/zero/1.0/).
 5 # 
 6 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 7 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 8 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 9 # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
10 # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
11 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
12 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13 # 
14 # Retrieved from: http://en.literateprograms.org/Hello_World_(occam)?oldid=19157
15 
16 kroc -lcourse -o hello_world-kroc hello_world-kroc.occ
17 ./hello_world-kroc


hijacker
hijacker
hijacker
hijacker

hello_world-classic.occ

 1 -- The authors of this work have released all rights to it and placed it
 2 -- in the public domain under the Creative Commons CC0 1.0 waiver
 3 -- (http://creativecommons.org/publicdomain/zero/1.0/).
 4 -- 
 5 -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 6 -- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 7 -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 8 -- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 9 -- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
10 -- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
11 -- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12 -- 
13 -- Retrieved from: http://en.literateprograms.org/Hello_World_(occam)?oldid=19157
14 
15 #INCLUDE "hostio.inc"
16 #USE "hostio.lib"
17 PROC hello.world (CHAN OF SP fs, ts)
18   SEQ
19     so.write.string.nl(fs, ts, "Hello World!")
20     SEQ i = 1 FOR 10
21       SEQ
22         so.write.int(fs, ts, i, 0)
23         so.write.nl(fs, ts)
24 :
25 


hijacker
hijacker
hijacker
hijacker

build_and_run-classic.sh

 1 #!/bin/bash
 2 # The authors of this work have released all rights to it and placed it
 3 # in the public domain under the Creative Commons CC0 1.0 waiver
 4 # (http://creativecommons.org/publicdomain/zero/1.0/).
 5 # 
 6 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 7 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 8 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 9 # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
10 # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
11 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
12 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13 # 
14 # Retrieved from: http://en.literateprograms.org/Hello_World_(occam)?oldid=19157
15 
16 kroc --octran-opts="--tlp-fsts" -lhostio -lconvert -o hello_world-classic hello_world-classic.occ
17 ./hello_world-classic


hijacker
hijacker
hijacker
hijacker

hello_world-kroc.occ

 1 -- The authors of this work have released all rights to it and placed it
 2 -- in the public domain under the Creative Commons CC0 1.0 waiver
 3 -- (http://creativecommons.org/publicdomain/zero/1.0/).
 4 -- 
 5 -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 6 -- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 7 -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 8 -- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 9 -- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
10 -- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
11 -- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12 -- 
13 -- Retrieved from: http://en.literateprograms.org/Hello_World_(occam)?oldid=19157
14 
15 #USE "course.lib"
16 PROC hello.world (CHAN BYTE scr!)
17   SEQ
18     out.string("Hello World!*n", 0, scr)
19     SEQ i = 1 FOR 10
20       SEQ
21         out.int(i, 0, scr)
22         scr ! '*n'
23 :


hijacker
hijacker
hijacker
hijacker