Starting function won't run


This is only a fraction of the code, but I can't get the first function to run. It just ends the lesson after the confirm.

Here is the start of my code:

confirm ("This is a simple text based adventure. Type north, east, south, and west to move. Type capital I to see what your carrying. Everything else should be typed in lowercase. Hit enter to start.")


function cabin() {
var location = 1751;
do {
var location = prompt("You are standing west of the remains of a wooden cabin in an open jungle. The wind is blowing so hard that the trees are almost side ways. There is a wooden door leading into a cave to the north, to the east is a river that looks like it may be traversable, and a barbed wire fence blocks passage to the south.")
switch(location) {

    case 'I':
        console.log("You are carrying a compass.");
        location = 1751;

    case 'west':
        console.log("You can't climb over the cabins debris");
        location = 1751;

    case 'south':
        console.log("You can't climb over the fence it's covered in barbed wire.");
        location = 1751;

    case 'east':

        location = 2151;

    case 'north':
        location = 1846;

        console.log("That isn't a legitimate response.");
        location = 1751;

while (location == 1751);

if(location === 1751) {
if(location === 2151) {
if(location === 1846) {

Running the function from the prompt
Running the function from the prompt

Hi kust need to call the function cabin...



Guys, can we have a bit of respect on this forum please, if anyone keeps spamming I will have to suspend or ban them.