File tree 8 files changed +98
-12
lines changed
8 files changed +98
-12
lines changed Original file line number Diff line number Diff line change
1
+ # Logs
2
+ logs
3
+ * .log
4
+ npm-debug.log *
5
+ yarn-debug.log *
6
+ yarn-error.log *
7
+ firebase-debug.log *
8
+ firebase-debug. * .log *
9
+
10
+ # Firebase cache
11
+ .firebase /
12
+
13
+ # Firebase config
14
+
15
+ # Uncomment this if you'd like others to create their own Firebase project.
16
+ # For a team working on the same Firebase project(s), it is recommended to leave
17
+ # it commented so all members can deploy to the same project(s) in .firebaserc.
18
+ # .firebaserc
19
+
20
+ # Runtime data
21
+ pids
22
+ * .pid
23
+ * .seed
24
+ * .pid.lock
25
+
26
+ # Directory for instrumented libs generated by jscoverage/JSCover
27
+ lib-cov
28
+
29
+ # Coverage directory used by tools like istanbul
30
+ coverage
31
+
32
+ # nyc test coverage
33
+ .nyc_output
34
+
35
+ # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
36
+ .grunt
37
+
38
+ # Bower dependency directory (https://bower.io/)
39
+ bower_components
40
+
41
+ # node-waf configuration
42
+ .lock-wscript
43
+
44
+ # Compiled binary addons (http://nodejs.org/api/addons.html)
45
+ build /Release
46
+
47
+ # Dependency directories
48
+ node_modules /
49
+
50
+ # Optional npm cache directory
51
+ .npm
52
+
53
+ # Optional eslint cache
54
+ .eslintcache
55
+
56
+ # Optional REPL history
57
+ .node_repl_history
58
+
59
+ # Output of 'npm pack'
60
+ * .tgz
61
+
62
+ # Yarn Integrity file
63
+ .yarn-integrity
64
+
65
+ # dotenv environment variables file
66
+ .env
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import Visualizer from './components/visualizer'
6
6
function App ( ) {
7
7
const [ arrOfCalls , setArrOfCalls ] = useState ( [ ] )
8
8
const [ funcName , setFuncName ] = useState ( "" )
9
- const [ renderSpeed , setRenderSpeed ] = useState ( 500 )
9
+ const [ renderSpeed , setRenderSpeed ] = useState ( 600 )
10
10
const [ isRunning , setIsRunning ] = useState ( false )
11
11
const [ isLoading , setIsLoading ] = useState ( false )
12
12
const [ jelly , setJelly ] = useState ( false )
Original file line number Diff line number Diff line change 1
1
/* eslint-disable */
2
2
import React from "react" ;
3
- import { Button } from "@material-ui/core" ;
3
+ import { Button , Slider } from "@material-ui/core" ;
4
4
import Switch from '@material-ui/core/Switch' ;
5
5
import FormControlLabel from '@material-ui/core/FormControlLabel' ;
6
6
import "./controls.css" ;
@@ -11,6 +11,10 @@ const Controls = (props: any) => {
11
11
props . setJelly ( ! props . jelly )
12
12
}
13
13
14
+ const onSlide = ( e : any , newValue : number | number [ ] ) => {
15
+ props . setRenderSpeed ( newValue )
16
+ }
17
+
14
18
return (
15
19
< div className = "ControlPanel" >
16
20
< Button
@@ -33,7 +37,6 @@ const Controls = (props: any) => {
33
37
{ " " }
34
38
Instructions + Reset{ " " }
35
39
</ Button >
36
-
37
40
38
41
< FormControlLabel
39
42
style = { { marginLeft : "10px" , marginTop : "10px" } }
@@ -44,6 +47,15 @@ const Controls = (props: any) => {
44
47
/> }
45
48
label = "Jelly"
46
49
/>
50
+
51
+ < Slider
52
+ defaultValue = { 50 }
53
+ aria-labelledby = "discrete-slider-always"
54
+ step = { 1 }
55
+ valueLabelDisplay = "on"
56
+ onChange = { onSlide }
57
+ min = { 10 }
58
+ />
47
59
</ div >
48
60
) ;
49
61
} ;
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import Typography from "@material-ui/core/Typography";
6
6
7
7
const useStyles = makeStyles ( {
8
8
root : {
9
- maxWidth : 593
9
+ maxWidth : 593 ,
10
10
} ,
11
11
bullet : {
12
12
display : "inline-block" ,
@@ -25,7 +25,11 @@ export default function OutlinedCard() {
25
25
const classes = useStyles ( ) ;
26
26
27
27
return (
28
- < Card className = { classes . root } variant = "outlined" style = { { marginLeft : "auto" , marginRight : "auto" , marginTop : "50px" } } >
28
+ < Card
29
+ className = { classes . root }
30
+ variant = "outlined"
31
+ style = { { marginLeft : "auto" , marginRight : "auto" , marginTop : "50px" } }
32
+ >
29
33
< CardContent >
30
34
< Typography variant = "h4" component = "h2" >
31
35
Instructions
@@ -68,7 +72,8 @@ export default function OutlinedCard() {
68
72
>
69
73
- If all goes well, you will see a nice recursive visualization of
70
74
your function < br />
71
- - Green node == initial call. Red node == recursive call. Blue node == base case. < br />
75
+ - Green node == initial call. Red node == recursive call. Blue node ==
76
+ base case. < br />
72
77
- Turn 'Jelly' off for a static graph < br /> - Click on any Node and
73
78
view it's return value
74
79
</ Typography >
@@ -77,10 +82,10 @@ export default function OutlinedCard() {
77
82
< iframe
78
83
width = "560"
79
84
height = "315"
80
- src = "https://www.youtube.com/embed/QwUZxCBtfLw"
85
+ src = "https://www.youtube.com/embed/-7rJv-yiTzc"
86
+ frameBorder = "0"
81
87
allow = "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
82
88
allowFullScreen
83
- frameBorder = "0"
84
89
> </ iframe >
85
90
</ CardContent >
86
91
</ Card >
Original file line number Diff line number Diff line change 9
9
10
10
const UserInput = ( props : any ) => {
11
11
const [ submittedCode , setCode ] = useState (
12
- "# DO NOT include any 'print(...)' statements!"
12
+ "# DO NOT include any 'print(...)' statements! \n\ndef fib(x):\n if x == 1 or x == 2:\n return 1\n return fib(x - 1) + fib(x - 2)\n\nfib(10) "
13
13
) ;
14
14
15
15
const runCode = async ( ) => {
@@ -46,7 +46,7 @@ const UserInput = (props: any) => {
46
46
try {
47
47
// send HTTP request to flask server and store
48
48
// response inside callTrace
49
- const domain = "https://recursion0r94s8df984.herokuapp.com " ;
49
+ const domain = "<BACKEND URL REMOTE CODE RUNNER> " ;
50
50
51
51
const options = `/execute?funcName=${ functionName } &funcCall=${ functionCall [ 0 ] } ` ;
52
52
const fetchConfig = {
@@ -92,6 +92,7 @@ const UserInput = (props: any) => {
92
92
setArrOfCalls = { props . setArrOfCalls }
93
93
jelly = { props . jelly }
94
94
setJelly = { props . setJelly }
95
+ setRenderSpeed = { props . setRenderSpeed }
95
96
/>
96
97
</ Fragment >
97
98
) ;
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const Visualizer = (props) => {
12
12
*/
13
13
const funcName = props . name
14
14
const callTrace = props . callTrace
15
- const ANIMATION_SPEED = props . renderSpeed ; // milliseconds per interval
15
+ const ANIMATION_SPEED = 1100 - props . renderSpeed * 10 ; // milliseconds per interval
16
16
const [ graphState , setGraphState ] = useState ( {
17
17
nodes : [ ] ,
18
18
links : [ ]
Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ def execute():
20
20
funcName = request .args ['funcName' ]
21
21
funcCall = request .args ['funcCall' ]
22
22
if funcName != funcCall [:len (funcName )]:
23
+ print (funcName )
24
+ print (funcCall [:len (funcName )] != funcName )
23
25
return "Check and make sure you defined EXACTLY one function." , 400
24
26
body = str (request .data )
25
27
inputCode = pi .parseInput (body )
Original file line number Diff line number Diff line change 4
4
import json
5
5
6
6
7
- API_KEY = os .environ .get ('API_KEY' )
7
+ API_KEY = os .environ .get ('API_KEY' )
8
8
9
9
def tryGet (token ):
10
10
time .sleep (10 )
You can’t perform that action at this time.
0 commit comments