Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/tensorflow/tfjs-examples
/ getRandomAction
Function
getRandomAction
snake-dqn/snake_game.js:45–47 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
43
* @
return
{0 | 1 | 2} Action represented as a number.
44
*/
45
export
function
getRandomAction() {
46
return
getRandomInteger(0, NUM_ACTIONS);
47
}
48
49
export
class
SnakeGame {
50
/**
Callers
2
snake_game_test.js
File · 0.90
playStep
Method · 0.90
Calls
1
getRandomInteger
Function · 0.90
Tested by
no test coverage detected