Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
27
Task/Babbage-problem/Bracmat/babbage-problem.bracmat
Normal file
27
Task/Babbage-problem/Bracmat/babbage-problem.bracmat
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
(
|
||||
500:?number {A child knows that 269696 is larger than 500*500,
|
||||
but not by much. It is safe to start the search with 500.}
|
||||
& whl {'whl' is shorthand for 'while'. It announces the evaluation of
|
||||
an expression that is repeated until it fails.}
|
||||
' ( @(!number*!number:~(? 269696)) { ~(? 269696) is a pattern. It says
|
||||
that it will not match numbers that do
|
||||
not end with the figures 269696.
|
||||
The question mark is there to match all
|
||||
the figures before 269696.}
|
||||
& !number:<99736 { We should under no circumstance try
|
||||
numbers that are larger than 99736.}
|
||||
& 1+!number:?number { If the number did not pass the test,
|
||||
we take the next number and repeat
|
||||
the test. }
|
||||
)
|
||||
& out
|
||||
$ ( str
|
||||
$ ( "The smallest number that ends with the figures 269696 when squared is "
|
||||
!number
|
||||
", since the square of "
|
||||
!number
|
||||
" is "
|
||||
!number*!number
|
||||
)
|
||||
)
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue