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
    
  
  
    
  | const useStateWithPromise = (initialState) => { | |
| const [state, setState] = useState(initialState); | |
| const resolverRef = useRef(null); | |
| useEffect(() => { | |
| if (resolverRef.current) { | |
| resolverRef.current(state); | |
| resolverRef.current = null; | |
| } | |
| /** | 
  
    
      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
    
  
  
    
  | def bfs(): | |
| q = Queue() | |
| q.enqueue([current_room["room_id"]]) | |
| visited = set() | |
| while q.size() > 0: | |
| path = q.dequeue() | |
| v = path[-1] | |
| if v not in visited: | |
| if v == 182: ### change to whatever room you want to find | |
| return path |