sequential circuit with d flip flop

Go back to your first post. Hit the modify icon.
Select the code, hit the # icon and then save it.

Why are you bothering to write all that logic simulation code?
The whole thing is simply a look up table. Two lines of code at the most.

Unless as was said it is an assignment from a class that you want us to do for you.

Why the title? The question has nothing to do with a sequential circuit or a d type flip flop unless you are holding back on more stuff as well.