Jump to content

Can anyone help me finish this???

Real_nimr0d_3
The code's in the file, I Just need to make 16 squares in the canvas and make them flip when I click on them and the color after flipping should be black or white and if one gets 4 blacks or whites in a row, the system should print You win.

 

Thanks!

Assignment #2.html

Fx-8320 Clocked@ 4.5Ghz, 2 * 4GB Corsair Vengeance Blue, 2 * Gigabyte rev1.0 R9 280x's, 2TB Seagate Drive, Gigabyte 990fxa-ud3 rev4.0 mobo, Fractal design Define R4 with SP120 High Performance Edition In the Side Panel, Corsair AX 860i, Corsair K60 Reds, Razor DeathAdder.

Link to comment
Share on other sites

Link to post
Share on other sites

I don't think your teacher will be too happy to see that people are doing/helping your homework.

Quote me to get a reply!

Link to comment
Share on other sites

Link to post
Share on other sites

I don't think your teacher will be too happy to see that people are doing/helping your homework.

OP, dont rely on other people to do your stuff. Do this yourself.

Diamond 5 in League :)

Link to comment
Share on other sites

Link to post
Share on other sites

This is your homework, dude. 

Mobo: Z97 MSI Gaming 7 / CPU: i5-4690k@4.5GHz 1.23v / GPU: EVGA GTX 1070 / RAM: 8GB DDR3 1600MHz@CL9 1.5v / PSU: Corsair CX500M / Case: NZXT 410 / Monitor: 1080p IPS Acer R240HY bidx

Link to comment
Share on other sites

Link to post
Share on other sites

I was hoping it was going to be pie :(

CPU: Ryzen 9 5900 Cooler: EVGA CLC280 Motherboard: Gigabyte B550i Pro AX RAM: Kingston Hyper X 32GB 3200mhz

Storage: WD 750 SE 500GB, WD 730 SE 1TB GPU: EVGA RTX 3070 Ti PSU: Corsair SF750 Case: Streacom DA2

Monitor: LG 27GL83B Mouse: Razer Basilisk V2 Keyboard: G.Skill KM780 Cherry MX Red Speakers: Mackie CR5BT

 

MiniPC - Sold for $100 Profit

Spoiler

CPU: Intel i3 4160 Cooler: Integrated Motherboard: Integrated

RAM: G.Skill RipJaws 16GB DDR3 Storage: Transcend MSA370 128GB GPU: Intel 4400 Graphics

PSU: Integrated Case: Shuttle XPC Slim

Monitor: LG 29WK500 Mouse: G.Skill MX780 Keyboard: G.Skill KM780 Cherry MX Red

 

Budget Rig 1 - Sold For $750 Profit

Spoiler

CPU: Intel i5 7600k Cooler: CryOrig H7 Motherboard: MSI Z270 M5

RAM: Crucial LPX 16GB DDR4 Storage: Intel S3510 800GB GPU: Nvidia GTX 980

PSU: Corsair CX650M Case: EVGA DG73

Monitor: LG 29WK500 Mouse: G.Skill MX780 Keyboard: G.Skill KM780 Cherry MX Red

 

OG Gaming Rig - Gone

Spoiler

 

CPU: Intel i5 4690k Cooler: Corsair H100i V2 Motherboard: MSI Z97i AC ITX

RAM: Crucial Ballistix 16GB DDR3 Storage: Kingston Fury 240GB GPU: Asus Strix GTX 970

PSU: Thermaltake TR2 Case: Phanteks Enthoo Evolv ITX

Monitor: Dell P2214H x2 Mouse: Logitech MX Master Keyboard: G.Skill KM780 Cherry MX Red

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

I asked for help, but looks like I ain't getting any. So, how do you help in programming here??? so, you guys just post on every question, that do it yourself???

Fx-8320 Clocked@ 4.5Ghz, 2 * 4GB Corsair Vengeance Blue, 2 * Gigabyte rev1.0 R9 280x's, 2TB Seagate Drive, Gigabyte 990fxa-ud3 rev4.0 mobo, Fractal design Define R4 with SP120 High Performance Edition In the Side Panel, Corsair AX 860i, Corsair K60 Reds, Razor DeathAdder.

Link to comment
Share on other sites

Link to post
Share on other sites

I asked for help, but looks like I ain't getting any. So, how do you help in programming here??? so, you guys just post on every question, that do it yourself???

You see, here's the thing. It isn't our job to do your homework. It's our hobby to help you. You can ask for help, but don't ask us to do your shit for you.

 

If I didn't know any better, it looks like you made this account to ask this of us. It may seem like a mean accusation, but for all I know, it's true. Look, I'm sorry if I come off as being a bit blunt and argumentative at times. It's not who I want to be.

Main Rig: CPU: AMD Ryzen 7 5800X | RAM: 32GB (2x16GB) KLEVV CRAS XR RGB DDR4-3600 | Motherboard: Gigabyte B550I AORUS PRO AX | Storage: 512GB SKHynix PC401, 1TB Samsung 970 EVO Plus, 2x Micron 1100 256GB SATA SSDs | GPU: EVGA RTX 3080 FTW3 Ultra 10GB | Cooling: ThermalTake Floe 280mm w/ be quiet! Pure Wings 3 | Case: Sliger SM580 (Black) | PSU: Lian Li SP 850W

 

Server: CPU: AMD Ryzen 3 3100 | RAM: 32GB (2x16GB) Crucial DDR4 Pro | Motherboard: ASUS PRIME B550-PLUS AC-HES | Storage: 128GB Samsung PM961, 4TB Seagate IronWolf | GPU: AMD FirePro WX 3100 | Cooling: EK-AIO Elite 360 D-RGB | Case: Corsair 5000D Airflow (White) | PSU: Seasonic Focus GM-850

 

Miscellaneous: Dell Optiplex 7060 Micro (i5-8500T/16GB/512GB), Lenovo ThinkCentre M715q Tiny (R5 2400GE/16GB/256GB), Dell Optiplex 7040 SFF (i5-6400/8GB/128GB)

Link to comment
Share on other sites

Link to post
Share on other sites

I asked for help, but looks like I ain't getting any. So, how do you help in programming here??? so, you guys just post on every question, that do it yourself???

We don't help children that do stuff like you

Diamond 5 in League :)

Link to comment
Share on other sites

Link to post
Share on other sites

I asked for help, but looks like I ain't getting any. So, how do you help in programming here??? so, you guys just post on every question, that do it yourself???

Well you are not asking for help, you are simply asking for someone to do your homework...

Hope I could help!

Specs: CPU: AMD FX-8320 @4.0ghz GPU: ASUS DCUII GTX 770 PSU: EVGA Supernova 750g CASE: Fractal Define R4 RAM: 8 Gigabytes ADATA 1333 Mhz MOBO: GIGABYTE GA-990FXA-UD3

 

Link to comment
Share on other sites

Link to post
Share on other sites

It's unfortunate that this was your first post, hopefully it doesn't scare you away from the forum.
So, welcome!
Hopefully getting us to do your homework wasn't the only reason you signed up :)

CPU: Ryzen 9 5900 Cooler: EVGA CLC280 Motherboard: Gigabyte B550i Pro AX RAM: Kingston Hyper X 32GB 3200mhz

Storage: WD 750 SE 500GB, WD 730 SE 1TB GPU: EVGA RTX 3070 Ti PSU: Corsair SF750 Case: Streacom DA2

Monitor: LG 27GL83B Mouse: Razer Basilisk V2 Keyboard: G.Skill KM780 Cherry MX Red Speakers: Mackie CR5BT

 

MiniPC - Sold for $100 Profit

Spoiler

CPU: Intel i3 4160 Cooler: Integrated Motherboard: Integrated

RAM: G.Skill RipJaws 16GB DDR3 Storage: Transcend MSA370 128GB GPU: Intel 4400 Graphics

PSU: Integrated Case: Shuttle XPC Slim

Monitor: LG 29WK500 Mouse: G.Skill MX780 Keyboard: G.Skill KM780 Cherry MX Red

 

Budget Rig 1 - Sold For $750 Profit

Spoiler

CPU: Intel i5 7600k Cooler: CryOrig H7 Motherboard: MSI Z270 M5

RAM: Crucial LPX 16GB DDR4 Storage: Intel S3510 800GB GPU: Nvidia GTX 980

PSU: Corsair CX650M Case: EVGA DG73

Monitor: LG 29WK500 Mouse: G.Skill MX780 Keyboard: G.Skill KM780 Cherry MX Red

 

OG Gaming Rig - Gone

Spoiler

 

CPU: Intel i5 4690k Cooler: Corsair H100i V2 Motherboard: MSI Z97i AC ITX

RAM: Crucial Ballistix 16GB DDR3 Storage: Kingston Fury 240GB GPU: Asus Strix GTX 970

PSU: Thermaltake TR2 Case: Phanteks Enthoo Evolv ITX

Monitor: Dell P2214H x2 Mouse: Logitech MX Master Keyboard: G.Skill KM780 Cherry MX Red

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

It's unfortunate that this was your first post, hopefully it doesn't scare you away from the forum.

So, welcome!

Hopefully getting us to do your homework wasn't the only reason you signed up :)

Hopefully :)

Diamond 5 in League :)

Link to comment
Share on other sites

Link to post
Share on other sites

Ya don't help me coz I forgot to rename the file. All I wanted to know was how to create 16 squares and make them clickable, even if it's a homework I don't see hows that wrong. I'll just ask a classmate, you people are horrible.

Fx-8320 Clocked@ 4.5Ghz, 2 * 4GB Corsair Vengeance Blue, 2 * Gigabyte rev1.0 R9 280x's, 2TB Seagate Drive, Gigabyte 990fxa-ud3 rev4.0 mobo, Fractal design Define R4 with SP120 High Performance Edition In the Side Panel, Corsair AX 860i, Corsair K60 Reds, Razor DeathAdder.

Link to comment
Share on other sites

Link to post
Share on other sites

Ya don't help me coz I forgot to rename the file. All I wanted to know was how to create 16 squares and make them clickable, even if it's a homework I don't see hows that wrong. I'll just ask a classmate, you people are horrible.

Horrible, more like non-doeveryone'shomework. School is for you to learn, not fob your assignments off to people on a forum just so you can get it done. 

CPU: Intel i7 8700K | CPU Cooler: be quiet! Dark Rock Pro 3 | RAM: Kingston HyperX 2x8GB | Motherboard: Asus ROG Z370-E | GPU: MSI GTX 970 | HDD: Seagate Barracuda 1TB & 2TB | SSD: Samsung 840 EVO 250GB & 970 EVO M.2 500GB | Case: Phanteks Enthoo Evolv X | PSU: Silverstone Platinum Strider 1100W | Monitor: AOC i2367Fh | Headphones: ATH-M40X | Mic: Antlion ModMic 4 | Keyboard: Corsair K70 RGB w/ MX Browns | Mouse: Logitech G502 HERO

 

Make sure you quote or mention the person you're replying to in your comment. Also remember to follow your thread when creating it to get a notification every time someone replies. 

Be nice and have fun. Cheers!

Link to comment
Share on other sites

Link to post
Share on other sites

Ya don't help me coz I forgot to rename the file. All I wanted to know was how to create 16 squares and make them clickable, even if it's a homework I don't see hows that wrong. I'll just ask a classmate, you people are horrible.

You didn't ask for help, you asked for the answer. Did you even attempt the question? What did you try? What went wrong? That's how we can help you

Link to comment
Share on other sites

Link to post
Share on other sites

I asked for help, but looks like I ain't getting any. So, how do you help in programming here??? so, you guys just post on every question, that do it yourself???

If you had a specific question about an error you receive, or how to do a certain part of the assignment, that would be a different case.  Here, you are just asking us to do it for you.

Desktop: Intel Core i7-6700K, ASUS Z170-A, ASUS STRIX GTX 1080 Ti, 16GB DDR4 RAM, 512 GB Samsund 840 Pro, Seasonic X series 650W PSU, Fractal Design Define R4, 2x5TB HDD

Hypervisor 1: Intel Xeon E5-2630L, ASRock EPC612D8, 16GB DDR4 ECC RAM, Intel RT3WB080 8-port RAID controller plus expansion card, Norco RPC-4020 case, 20x2TB WD Red HDD

Other spare hypervisors: Dell Poweredge 2950, HP Proliant DL380 G5

Laptops: ThinkPads, lots of ThinkPads

 

Link to comment
Share on other sites

Link to post
Share on other sites

@Real_nimr0d_3, I won't download a file from an unknown source. Based on your description of the problem in the OP here are some pointers.

 

To create a grid of 4x4 grid do

 

     do row = 0 to 3 {

          do column = 0 to 3 {

              Grid [row, column] = CreateASqaure()

              }

           }

 

To determine where on a grid the mouse was clicked

 

     row = CoordinatesOfMouseClick ().YPos div WidthOfSquare

     column = CoordinatesOfMouseClick().XPos div HeightOfSquare

     square = grid [row, column]

 

To flip a square

 

     square.White = not square.White

 

To determine win (same color across a row)

 

     winner = ((grid [row, 0].White and grid [row, 1].White and grid [row, 2].White and grid [row, 3].White)

                     or ((not grid [row, 0].White) and (not grid [row, 1].White) and (not grid [row, 2].White) and (not grid [row, 3].White)))

80+ ratings certify electrical efficiency. Not quality.

 

Link to comment
Share on other sites

Link to post
Share on other sites

I assume you must've learned this in class, or else it wouldn't have been assigned as homework. Listen more attentively next time ;)

Not saying OP shouldn't do his own homework here, but oftentimes my CSci professors will assign things that weren't covered in class or the book, and require either internet research, the help of higher-level students, or the help of family members (in my case, my dad).

--Penis size, like resolution, is just a number--

--Hail GabeN--

Link to comment
Share on other sites

Link to post
Share on other sites

Welcome to the forums.

Asking for help with programming usually works like this (on
pretty much any forum, not just here):

  • You try to solve the problem yourself.
  • If you fail, you post the work you have done so far along with
    the assignment (with code tags and not as an external source) and
    ask for help.
  • Somebody will usually point out specific problems in your
    code and give you hints what should be done differently/better.
  • You go back and implement those suggestions.
  • If it still doesn't work, see step 2.

If people can see that you have actually done some work yourself (even if
it's horrible) they will be much more inclined to help you.

So, instead of just this:

The code's in the file, I Just need to make 16 squares in the canvas and make them flip when I click on them and the color after flipping should be black or white and if one gets 4 blacks or whites in a row, the system should print You win.

It should look a bit like this:

Hey fellas,

I have the following assignment: blablabla

Here's my code so far:

bla code bli code
The output I get from this code is:
Your incorrect result
Instead I would expect:
Your expeced result
I do not quite understand why this is not working, any help would
be appreciated. Thanks!

 



It's a pretty basic concept TBH: Help is given to those who display willingness to

help themselves.

BUILD LOGS: HELIOS - Latest Update: 2015-SEP-06 ::: ZEUS - BOTW 2013-JUN-28 ::: APOLLO - Complete: 2014-MAY-10
OTHER STUFF: Cable Lacing Tutorial ::: What Is ZFS? ::: mincss Primer ::: LSI RAID Card Flashing Tutorial
FORUM INFO: Community Standards ::: The Moderating Team ::: 10TB+ Storage Showoff Topic

Link to comment
Share on other sites

Link to post
Share on other sites

This thread went to shit real quick. Totally irrelevant, sorry.

i5 3570k - MSI Z77 GD65 - 16GB Corsair Vengeance - Galaxy GTX 780 - Corsair AX650 - Custom CPU Loop - Corsair 650D - OCZ Agility 4 128GB - WD Black 640GB

Link to comment
Share on other sites

Link to post
Share on other sites

I remember when I was such an 'online brat'...

Link to comment
Share on other sites

Link to post
Share on other sites

Sort of like connect 4?

4inarowboard.png

 

If so then I'll explain but I won't give you the code, that's something for you to figure out yourself.

 

  1. First you need to find the most efficient way of displaying the columns, my recommended way in this case is by using a tilemap
  2. Tilemaps can be created by having a array of rows and columns, you'd have a loop which goes through the array and everytime it'll multiply the position of the row by the current row that is read (while you're currently not on the last row, do something) --> (display a new square at [current row multipled by width of one square] if your current row is on the last row increment the column by 1 and reset the row)
  3. Find the mouse coordinates and do this (divide the mouse coordinates by size of one square and then you'd find what square you're currently on)
  4. When you click (flip the square you clicked on and render a new square with a black colour and set the state of that square to flipped)
  5. After the state has been changed (check whether the row across on each side has 4 flipped columns if so then you've got a hit and won or whatever)
  6. To check whether the columns on each side have 4 squares flipped you do this (when done flipping use the clicked square and check whether everything up to 3 squares over on each side are flipped if so then won) so check whether everything on top, up to 3 columns are flipped if so won otherwise check next direction and continue on until it has checked each possibly side

 

Not sure whether I've explained this well enough, I'm not the best when it comes to explaining algorithms :/ hope that it was at least help full though

Link to comment
Share on other sites

Link to post
Share on other sites

LOOL so many people shitting on this guy.

They're shitting on him because he shit on them when they said they weren't willing to allow him to use his membership on these forums to cheat on his homework.

We're here to help people because it's our hobby, not because we want to be what they use to cheat on their assignments.

CPU: Intel Core i5 4670K @ 4.4 GHz Motherboard: MSI Z87 G43 RAM: 8GB Corsair Vengeance 1600MHz GPU: EVGA GeForce GTX 980 Superclocked Case: Bitfenix Ronin

Storage: 120 GB Samsung 840 series SSD, WD Green 2TB PSU: XFX core edition 650W Display(s): ASUS VE228H 21.5IN 1080P Cooling: CM Hyper 212+

Keyboard: Microsoft P.O.S Mouse: Corsair Raptor M40 Sound: Sennheiser PC 330 Headset

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×