This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(new MaterialApp( | |
home: new MyHomePage(), | |
)); | |
} | |
class MyHomePage extends StatelessWidget { | |
Widget build(BuildContext context) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(new TestApp()); | |
} | |
class TestApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return new MaterialApp( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fib(1, 1). | |
fib(2, 1). | |
fib(X, Y) :- myFib(X, Y, [1,1]). | |
count(0, []). | |
count(Count, [Head|Tail]) :- count(TailCount, Tail), Count is TailCount + 1. | |
head(H, [Head|Tail]) :- H is Head. | |
myFib(P, R, V) :- count(C, V), C = P, head(R, V). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Number fib := method( | |
values := list(1,1) | |
if (self == 1) then( | |
self println | |
) else( | |
if (self == 2) then (1 println) else( | |
for(i, 3, self, | |
self fibAtIndex(values) | |
) | |
values last println |