Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
11
Task/Balanced-brackets/Oforth/balanced-brackets.oforth
Normal file
11
Task/Balanced-brackets/Oforth/balanced-brackets.oforth
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
String method: isBalanced
|
||||
| c |
|
||||
0 self forEach: c [
|
||||
c '[' == ifTrue: [ 1+ continue ]
|
||||
c ']' <> ifTrue: [ continue ]
|
||||
1- dup 0 < ifTrue: [ drop false return ]
|
||||
]
|
||||
0 == ;
|
||||
|
||||
: genBrackets(n)
|
||||
"" #[ "[" "]" 2 rand 2 == ifTrue: [ swap ] rot + swap + ] times(n) ;
|
||||
Loading…
Add table
Add a link
Reference in a new issue