Hi, I am trying to make a hangman game in Matlab. However, the code does not generate the txt file. Can anyone help me t

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Hi, I am trying to make a hangman game in Matlab. However, the code does not generate the txt file. Can anyone help me t

Post by answerhappygod »

Hi, I am trying to make a hangman game in Matlab. However, the code does not generate the txt file.
Can anyone help me to create a simple hangman game code that generates txt file?
The code must io include:
Loops
Vector or Matrices
Conditional execution
Hi I Am Trying To Make A Hangman Game In Matlab However The Code Does Not Generate The Txt File Can Anyone Help Me T 1
Hi I Am Trying To Make A Hangman Game In Matlab However The Code Does Not Generate The Txt File Can Anyone Help Me T 1 (148.15 KiB) Viewed 85 times
Lurrent Folder game.m + D Name words.txt scissors2.png scissors1.png rockpaperscissors.m rock2.png Editor - DASEM 1 (1ST)\Matlab C\Week 7\Game Project\demo2.m rockpaperscissors.mx demo.m demo2.m 1 clc; 2 clear all; rock1.png ovou own words = readfile("words.txt"); % total size of above words wordSize = size(words); % Getting a random index in range of above length randomWord = randi(wordSize, 1); % 1 represent we need 1 digit in words size paper2.png paper1.png game.m demo2.m demo2.asv demo.m = 10 % select that random word 11 guessword = words (randomWord); 12 % Calculate the length of above random word 13 wordLength = strlength(guessword); % strlength for string length 14 15 % no of choices the user have 16 trial = 18; 17 % The letters guessed by users 18 entered Letters = "; 19 20 while trial > 0 21 fprintf("You have %d lives left.\n',lives); 22 % initialising spaces 23 space = 0; fprintf("guessWord: "): Command Window Unrecognized function or variable 'readfile'. 24 words.txt (Text Document) Error in demo2 (line 4) words = readfile("words.txt");
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply