#1
25th November 2015, 04:47 PM
| |||
| |||
BCPL and B Languages
Hey buddy can you please get some information about the BCPL (Basic Combined Programming Language) and B Language so that I can go through it easily?
|
#2
25th November 2015, 05:41 PM
| |||
| |||
Re: BCPL and B Languages
Feel free buddy I will help you here to get the information about the BCPL (Basic Combined Programming Language) and b Language so that you can have idea about it (Basic Combined Programming Language) Originally intended for writing compilers for other languages, BCPL is no longer in common use BCPL was the first brace programming language BCPL was a response to difficulties with its predecessor Combined Programming Language (CPL) It was designed so that small and simple compilers could be written for it B Language B is a programming language was setup in 1969 and developed at Bell Labs circa B was derived from BCPL, and its name may be a contraction of BCPL B was designed for recursive, non-numeric, machine independent applications, Example of the B Language GET "LIBHDR" LET START() = VALOF $( FOR I = 1 TO 5 DO WRITEF("%N! = %I4*N", I, FACT(I)) RESULTIS 0 $) AND FACT(N) = N = 0 -> 1, N * FACT(N - 1) Count solutions to the N queens problem: GET "LIBHDR" GLOBAL $( COUNT: 200 ALL: 201 $) LET TRY(LD, ROW, RD) BE TEST ROW = ALL THEN COUNT := COUNT + 1 ELSE $( LET POSS = ALL & ~(LD | ROW | RD) UNTIL POSS = 0 DO $( LET P = POSS & -POSS POSS := POSS - P TRY(LD + P << 1, ROW + P, RD + P >> 1) $) $) LET START() = VALOF $( ALL := 1 FOR I = 1 TO 12 DO $( COUNT := 0 TRY(0, 0, 0) WRITEF("%I2-QUEENS PROBLEM HAS %I5 SOLUTIONS*N", I, COUNT) ALL := 2 * ALL + 1 $) RESULTIS 0 $) |
Thread Tools | Search this Thread |
|