From 0d35087bc6fedc352205dda45801cf72bb8a89f7 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 26 Dec 2022 15:19:17 -0500 Subject: [PATCH] Choose a more interesting example snippet (#1394) --- playground/src/App.tsx | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/playground/src/App.tsx b/playground/src/App.tsx index 7b4cf2537d..9106ca31f4 100644 --- a/playground/src/App.tsx +++ b/playground/src/App.tsx @@ -8,7 +8,32 @@ import { AVAILABLE_OPTIONS } from "./ruff_options"; import { Config, getDefaultConfig, toRuffConfig } from "./config"; import { Options } from "./Options"; -const DEFAULT_SOURCE = "print(1 + 2)"; +const DEFAULT_SOURCE = + "# Define a function that takes an integer n and returns the nth number in the Fibonacci\n" + + "# sequence.\n" + + "def fibonacci(n):\n" + + " if n == 0:\n" + + " return 0\n" + + " elif n == 1:\n" + + " return 1\n" + + " else:\n" + + " return fibonacci(n-1) + fibonacci(n-2)\n" + + "\n" + + "# Use a for loop to generate and print the first 10 numbers in the Fibonacci sequence.\n" + + "for i in range(10):\n" + + " print(fibonacci(i))\n" + + "\n" + + "# Output:\n" + + "# 0\n" + + "# 1\n" + + "# 1\n" + + "# 2\n" + + "# 3\n" + + "# 5\n" + + "# 8\n" + + "# 13\n" + + "# 21\n" + + "# 34\n"; function restoreConfigAndSource(): [Config, string] { const value = lzstring.decompressFromEncodedURIComponent(