The tag has no wiki summary.

learn more… | top users | synonyms

5
votes
2answers
168 views

compare two logic commented one to my logic java

I'm trying to review this block of code to make sure logic is fine. The first version that I commented will create duplicated order 'my college developer' but I fixed it but "really not sure" I want ...
2
votes
2answers
57 views

Javascript card game, hand evaluation - review and suggest optimizations

So I have the following code (it looks long but it's not to bad): function evaluate_cards(hand){ var hand_length = hand.length; var num_of_sets = 0; var num_of_runs = 0; var ...
4
votes
2answers
79 views

Optimizing if-statement with for-loop

I have been staring at this code for awhile now and I am thinking there is a way to optimize it (namely the if-else statement with the for-loops). Any advice would be greatly appreciated. ...
0
votes
0answers
70 views

How to adjust Foreground extraction in prediction

This is my program for ForegroundExtraction, which I've made into a function: int ForegroundExtraction() { VideoCapture capture("recognition.mp4"); if (!capture.isOpened()) return 0; ...
0
votes
1answer
80 views

Bitwise Logic optimization

I should be able to figure this out on my own, but I can't seem to wrap my head around how to optimize this set of logic for interpreting the existence of URL parameters. Below is my code: <cfif ...
1
vote
1answer
723 views

Text-based adventure RPG inventory code

I am trying to make a text-based RPG in Python and Pygame. I need a way to manage my inventory slots. Currently, I have no way to find out what is currently equipped. I can only overwrite it, even ...
0
votes
1answer
69 views

can this code be optimized more?

A company sells ipods online. There are 100 stocks maintained at Argentina and Brazil. A single ipod costs $100 in Brazil and $50 in Argentina. The cost of exporting stocks from one country to the ...
2
votes
1answer
102 views

How can improve the run time of this code?

Here the link of problem for which i need your help. http://www.codechef.com/JUNE13/problems/COLLECT I came up with solution and working fine for all cases but it take more time. I need your help in ...
3
votes
2answers
64 views

How to avoid goto without replicating code in my meshing algorithm?

To generate faces of a Minecraft-like world from a three dimensional array, I developed the following meshing algorithm. The faces are given vertices and indices. A vertex consists of a position in ...
3
votes
3answers
425 views

Advice on program which calculates scores for predictions of Football scores

I am writing a program which calculates the scores for participants of a small "Football Score Prediction" game. rules are: if the match result(win/loss/draw) is predicted correctly: 1 point if the ...
2
votes
1answer
83 views

Implementing logic in a different way

I need to write a function which will do the following functionalities I would get a string and a array as input parameters The string would be like one of the following for example catalog ...
3
votes
1answer
192 views

Is there better way of writing these IF checks?

This is what I have, But I think I can write it in a sohrter and more efficient way too, what do you suggest? string actionString= string.Empty; if (auditAction == ...
4
votes
1answer
157 views

Implementing C++ boolean function objects with logical operator combinations

I want to make a C++ object hierarchy of "classifiers", which can be composed together via logical operators into a single classifier that implements the whole logical combination. This is actually ...
14
votes
3answers
2k views

Java TicTacToe (logic)

I'm currently studying java by myself, the book I'm using (while very good) lacks feedback (obviously), while trying to write this program I found myself solving most of the problems I've encountered ...
3
votes
1answer
145 views

Review logic in shell script

I have a shell script to mount different remote systems. While it does work, the area I struggle with (not being a programmer) is the logic of the script: it feels quite stilted and there seems to be ...
2
votes
2answers
119 views

Filtering logic

I have a FileAsset class. I have a set of 'filters' with which I determine if a FileAsset should be written to my database. Below is a telescoped version of how the filters work now. My big ...