Create a text file called scores.txt with notepad

Assignment Help Computer Engineering
Reference no: EM13324671

You have to create a list called scores that stores 4 numbers: the first two numbers are the number of win and lost games for the computer and the other two for the human opponent. Create a text file called scores.txt with notepad with two lines: the first two lines are the computer scores and the second line human scores.

Write a function called initScores to open the file and returns the list scores with the numbers in the text file.

>>initScores(scores)
[0,0,0,0]

Test it by adding numbers manually in the text file

 

Reference no: EM13324671

Questions Cloud

Implement the playexpert mode of the game : Whether or not you have managed to implement the playExpert mode of the game. If you do not manage to implement it you should carry on with the rest of the questions in novice mode.
Write a program that initializes the list scores : Write a program that initializes the list scores with the values in the text file scores.txt and calls the gameNim() function, once the game has finished the list scores are updated with the results.
Compute the value of ka for the acid hbro : The pH in a 0.25 M solution of the acid HBrO is 4.65. Using this, calculate the value of Ka for the acid HBrO.
What is the magnitude of the resultant field : An electric field of 10.6 N/C directed due north is superposed on an existing electric field of 15.3 N/C directed due east. What is the magnitude of the resultant field
Create a text file called scores.txt with notepad : Create a text file called scores.txt with notepad with two lines: the first two lines are the computer scores and the second line human scores.
Describe the order driven market trading system : Describe the order driven market trading system , the quote driven trading system and the hybrid trading system and provide examples.
Define what is the concentration of the acid : If an 20 mL acetic acid is neutralized with 50 mL of 0.8 M NaOH, what is the concentration of the acid
Find the maximum time taken for the block to come to a rest : If the initial speed of the block is increased to infinity, it turns out that the time taken for the block to come to a rest approaches a finite value whereas the distance traveled approaches infinity, Find the maximum time taken for the block to c..
Write a function playexpert : Write a function playExpert(marbles) that given a number of marbles returns the number of marbles that the computer will take following the expert mode rules.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Describe data, information, and decision making

assume you are a DBA staff member. What data dimensions would you describe to top-level managers to obtain their support for the data administration function.

  What is the exact name of the exam

Why or why not? How do you think this exam would this exam benefit your career goals?

  Developing the function to list software installed on system

Write down a function which list the software (name and vendor) installed over the computer specified by the input argument. The function should output the list to screen and output the list to the CSV file.

  Define flow boundaries

Using a data flow diagram and a processing narrative, describe a computer-based system that has distinct transform flow characteristics. Define flow boundaries, and map the DFD into a software architecture using the technique described in Section ..

  How a box of caramel delites girl scout cookies

How to a box of Caramel deLites Girl Scout cookies Every spring you looking forward to buying a box of Caramel deLites Girl Scout cookies

  What are the steps to move all of email folders

What are the steps to move all of email folders from my MSN Hotmail account to an external hard drive without having to open each email individually?

  What circumstances will you use flash over an html editor

Flash is a popular tool to enhance site interactivity. I require recommendations for how to integrate Flash into a website effectively. Under what circumstances would you use Flash over an HTML editor?

  Developing an algorithm to read an arbitrary number

Develop an algorithm to read an arbitrary number of the data records, each consisting of an age, name, and code.

  Display the semantic errors in the compilation listing

Variables and parameter names have local scope. The scope rules require that all names be declared and prohibit duplicate names within the same scope

  Words might appear multiple times in the entered text

write down a program that allows the user to enter a line of text. I then need to use the stringTokenizer to break the input into words. I have to Put these words into a link list and then print them out in alphabetical order.

  Define how referential integrity actions can be used

explain the default rules for enforcing referential integrity constraints. Explain how referential integrity actions can be used to override the default referential integrity constraints.

  Make a menu bar with a file menu

make a menu bar with a File menu that includes a Perform Action command and an Exit command. The Perform Action command computes either the sum or average of the rows or columns in the array and displays the result in a message box. The Exit comma..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd