This is a JAVASCRIPT question. Please give a helpful answer. I am confused on pl
ID: 3864572 • Letter: T
Question
This is a JAVASCRIPT question. Please give a helpful answer. I am confused on placing adventurer in the array. Create an object that represents the adventurer. This includes how many hit points she has left, current location on map (in terms of row and column), and an array of prizes. Randomly assign a starting and goal location (indicate with a 'S' and 'G' respectively). Make sure they do not fall on the same square, or on any square taken by a prize, wall or adventure. Place these in the matrix. Text Adventure Game: This homework assignment involves a JavaScript text adventure game. Create a 8x8 game map on which an adventurer is placed (randomly). The goal of the adventurer is to exit the game with two prizes. The adventurer moves one square at a time (left, right, up down) and encounters either an obstacle (can't move there), a prize, or a challenge. The challenge involves asking the user if they want to take the challenge or back out. P1 P2Explanation / Answer
A)
public static class DoubleArrayInputOutputFactory
{
private static Dictionary<DoubleArrayReaderType,
IDoubleArrayReader> readers;
static DoubleArrayInputOutputFactory()
{
readers = new Dictionary<DoubleArrayReaderType, IDoubleArrayReader>();
foreach (Type type in Assembly.GetExecutingAssembly().GetTypes())
{
try
{
var instance = Activator.CreateInstance(type);
if (instance is IDoubleArrayReader)
{
readers.Add((instance as IDoubleArrayReader).Type,
(instance as IDoubleArrayReader));
}
}
catch
{
continue;
}
}
}
public static IDoubleArrayReader CreateDoubleArrayReader(DoubleArrayReaderType type)
{
return readers[type];
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.