{"action":"opened","issue":{"url":"https://api.github.com/repos/btatic/Project1_Battleship/issues/5","repository_url":"https://api.github.com/repos/btatic/Project1_Battleship","labels_url":"https://api.github.com/repos/btatic/Project1_Battleship/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/btatic/Project1_Battleship/issues/5/comments","events_url":"https://api.github.com/repos/btatic/Project1_Battleship/issues/5/events","html_url":"https://github.com/btatic/Project1_Battleship/issues/5","id":150968144,"number":5,"title":"what i have so far ","user":{"login":"btatic","id":18352036,"avatar_url":"https://avatars.githubusercontent.com/u/18352036?v=3","gravatar_id":"","url":"https://api.github.com/users/btatic","html_url":"https://github.com/btatic","followers_url":"https://api.github.com/users/btatic/followers","following_url":"https://api.github.com/users/btatic/following{/other_user}","gists_url":"https://api.github.com/users/btatic/gists{/gist_id}","starred_url":"https://api.github.com/users/btatic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btatic/subscriptions","organizations_url":"https://api.github.com/users/btatic/orgs","repos_url":"https://api.github.com/users/btatic/repos","events_url":"https://api.github.com/users/btatic/events{/privacy}","received_events_url":"https://api.github.com/users/btatic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-25T20:11:22Z","updated_at":"2016-04-25T20:11:22Z","closed_at":null,"body":"#include <iostream>\r\n#include <ctime>\r\n#include <cstdlib>\r\n#include <iomanip>\r\nusing namespace std;\r\n// Boris Tatic\r\n// section 2\r\n// project 3\r\n// Battleship\r\nstruct playeraircraftcarrier5{\r\nint horizontal=0;\r\nint vertical=0;\r\nint part1=0;//x;\r\nint part2=part1+1;\r\nint part3=part2+1;\r\nint part4=part3+1;\r\nint part5=part4+1;\r\nint nothit='o';\r\nint hit='x';\r\n};\r\n\r\nstruct playerbattleship4{\r\nint horizontal=0;\r\nint vertical=0;\r\nint part1=0;//x;\r\nint part2=part1+1;\r\nint part3=part2+1;\r\nint part4=part3+1;\r\nint nothit='o';\r\nint hit='x';\r\n};\r\n\r\nstruct playersubmarine3{\r\nint horizontal=0;\r\nint vertical=0;\r\nint part1=0;//x;\r\nint part2=part1+1;\r\nint part3=part2+1;\r\nint nothit='o';\r\nint hit='x';\r\n};\r\n\r\nstruct playerdestoryer3{\r\nint horizontal=0;\r\nint vertical=0;\r\nint part1=0;//x;\r\nint part2=part1+1;\r\nint part3=part2+1;\r\nint nothit='o';\r\nint hit='x';\r\n};\r\nstruct playerpatrolboat2{\r\nint horizontal=0;\r\nint vertical=0;\r\nint part1=0;//x;\r\nint part2=part1+1;\r\nint nothit='o';\r\nint hit='x';\r\n};\r\nstruct  computeraircraftcarrier5{\r\nint horizontal=0;\r\nint vertical=0;\r\nint part1=0;//x;\r\nint part2=part1+1;\r\nint part3=part2+1;\r\nint part4=part3+1;\r\nint part5=part4+1;\r\nint nothit='o';\r\nint hit='x';\r\n};\r\n\r\nstruct computerbattleship4{\r\nint horizontal=0;\r\nint vertical=0;\r\nint part1=0;//x;\r\nint part2=part1+1;\r\nint part3=part2+1;\r\nint part4=part3+1;\r\nint nothit='o';\r\nint hit='x';\r\n};\r\n\r\nstruct computersubmarine3{\r\nint horizontal=0;\r\nint vertical=0;\r\nint part1=0;//x;\r\nint part2=part1+1;\r\nint part3=part2+1;\r\nint nothit='o';\r\nint hit='x';\r\n};\r\n\r\nstruct computerdestoryer3{\r\nint horizontal=0;\r\nint vertical=0;\r\nint part1=0;//x;\r\nint part2=part1+1;\r\nint part3=part2+1;\r\nint nothit='o';\r\nint hit='x';\r\n};\r\nstruct computerpatrolboat2{\r\nint horizontal=0;\r\nint vertical=0;\r\nint part1=0;//x;\r\nint part2=part1+1;\r\nint nothit='o';\r\nint hit='x';\r\n};\r\nint main()\r\n{\r\nint leftlegend=0;\r\nint comleftlegend=0;\r\n\r\nint playerrow=10;\r\nint playercol=10;\r\n\r\nint computerrow=10;\r\nint computercol=10;\r\n\r\nchar playerinputx;\r\nint playerinputxvalue;\r\ncout<<\"please choose the X coordinate for your shot(A-J): \";\r\ncin>>playerinputx;\r\ncout<<\" \"<<endl;\r\nif (playerinputx=='A'||'a')\r\n    playerinputxvalue=0;\r\nif (playerinputx=='B'||'b')\r\n    playerinputxvalue=1;\r\nif (playerinputx=='C'||'c')\r\n    playerinputxvalue=2;\r\nif (playerinputx=='D'||'d')\r\n    playerinputxvalue=3;\r\nif (playerinputx=='E'||'e')\r\n    playerinputxvalue=4;\r\nif (playerinputx=='F'||'f')\r\n    playerinputxvalue=5;\r\nif (playerinputx=='G'||'g')\r\n    playerinputxvalue=6;\r\nif (playerinputx=='H'||'h')\r\n    playerinputxvalue=7;\r\nif (playerinputx=='I'||'i')\r\n    playerinputxvalue=8;\r\nif (playerinputx=='J'||'j')\r\n{\r\n playerinputxvalue=9;\r\n}\r\ncout<<\"x is: \"<<playerinputxvalue<<endl;\r\n\r\nint playerinputy=0;\r\ncout<<\"please choose the Y coordinate for your shot(0-9): \";\r\ncin>>playerinputy;\r\ncout<<\"\"<<endl;\r\nint playershot=0;\r\nchar z;\r\nwhile(playershot<100)\r\n{\r\n\r\nwhile(playershot<1)\r\n{\r\n    \r\n}\r\ncout<<\"    Player\"<<endl;\r\ncout<<\"  0123456789\"<<endl;\r\n\r\nchar playerboard[playerrow][playercol];\r\nfor (int playerx=0;playerx<playercol;playerx++)\r\n{\r\n    if(leftlegend==0)\r\n    {\r\n    cout<<\"A|\";\r\n    }\r\n     if(leftlegend==1)\r\n    {\r\n    cout<<\"B|\";\r\n    }\r\n     if(leftlegend==2)\r\n    {\r\n    cout<<\"C|\";\r\n    }\r\n     if(leftlegend==3)\r\n    {\r\n    cout<<\"D|\";\r\n    }\r\n     if(leftlegend==4)\r\n    {\r\n    cout<<\"E|\";\r\n    }\r\n     if(leftlegend==5)\r\n    {\r\n    cout<<\"F|\";\r\n    }\r\n     if(leftlegend==6)\r\n    {\r\n    cout<<\"G|\";\r\n    }\r\n     if(leftlegend==7)\r\n    {\r\n    cout<<\"H|\";\r\n    }\r\n     if(leftlegend==8)\r\n    {\r\n    cout<<\"I|\";\r\n    }\r\n     if(leftlegend==9)\r\n    {\r\n    cout<<\"J|\";\r\n    }\r\n\r\n    for (int playery=0;playery<playerrow;playery++)\r\n    {\r\n        playerboard[playerx][playery]='*';\r\n        cout<<playerboard[playerx][playery];\r\n    }\r\n    cout<<\" \"<<endl;\r\n    leftlegend++;\r\n}\r\n\r\ncout<<\" \"<<endl;\r\ncout<<\"----------\"<<endl;\r\ncout<<\"----------\"<<endl;\r\ncout<<\" \"<<endl;\r\n\r\ncout<<\"   Computer\"<<endl;\r\ncout<<\"  0123456789\"<<endl;\r\nchar computerboard[computerrow][computercol];\r\nfor (int computerx=0;computerx<computercol;computerx++)\r\n{\r\n    if(comleftlegend==0)\r\n    {\r\n    cout<<\"A|\";\r\n    }\r\n     if(comleftlegend==1)\r\n    {\r\n    cout<<\"B|\";\r\n    }\r\n     if(comleftlegend==2)\r\n    {\r\n    cout<<\"C|\";\r\n    }\r\n     if(comleftlegend==3)\r\n    {\r\n    cout<<\"D|\";\r\n    }\r\n     if(comleftlegend==4)\r\n    {\r\n    cout<<\"E|\";\r\n    }\r\n     if(comleftlegend==5)\r\n    {\r\n    cout<<\"F|\";\r\n    }\r\n     if(comleftlegend==6)\r\n    {\r\n    cout<<\"G|\";\r\n    }\r\n     if(comleftlegend==7)\r\n    {\r\n    cout<<\"H|\";\r\n    }\r\n     if(comleftlegend==8)\r\n    {\r\n    cout<<\"I|\";\r\n    }\r\n     if(comleftlegend==9)\r\n    {\r\n    cout<<\"J|\";\r\n    }\r\n\r\n    for (int computery=0;computery<computerrow;computery++)\r\n    {\r\n        computerboard[computerx][computery]='*';\r\n        cout<<computerboard[computerx][computery];\r\n    }\r\n    cout<<\" \"<<endl;\r\n    comleftlegend++;\r\n}\r\ncout<<\" \"<<endl;\r\ncout<<\"___________\"<<endl;\r\ncout<<\"| Legend  |\"<<endl;\r\ncout<<\"|Boat =  o|\"<<endl;\r\ncout<<\"|Miss =  m|\"<<endl;\r\ncout<<\"|Hit  =  x|\"<<endl;\r\ncout<<\"|Water = *|\"<<endl;\r\ncout<<\"-----------\"<<endl;\r\ncout<<\" \"<<endl;\r\ncout<<\" \"<<endl;\r\ncout<<\"the shots so far \"<<endl;\r\ncout<<playershot<<endl;\r\ncin>>z;\r\nplayershot++;\r\ncomleftlegend=0;\r\nleftlegend=0;\r\n}\r\n    return 0;\r\n}\r\n"}}