Sponsored Content
Full Discussion: logic question
Top Forums Shell Programming and Scripting logic question Post 302210671 by ccp on Tuesday 1st of July 2008 03:43:54 PM
Old 07-01-2008
logic question

Hi, this is logic question, not sure anyone can answer

I have 5 balls, and balance in front of me, this 5 balls look the same, but one of them is heavier, I need to use balance to find the heavier ball

my approach is take any 2 balls, 2 balls in each side of balance, if the weight the same, then fifth ball is the answer, if one of the two balls group is heavier, then take each ball from that 2 balls group to each side of balance, the heavier one is the answer .

can we write it programatically with unix or perl?

Thanks

Chris
 

2 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parent/Child Scripting logic Question

I have Parent script that will execute a child script. The child script will take about 2 hours to run and I wanted to somehow build a logic for parent.sh to wait and perform ps -ef|grep cp|grep -v on the child.sh cp process and loop and check return code of child.sh $? as well. Once they are both... (3 Replies)
Discussion started by: jigarlakhani
3 Replies

2. Shell Programming and Scripting

More a logic than a programming question

hello, I'm a littlebit lost... i have a table of single names and combination of two names and i want a table of ALL single names with ALL combinations (also the indirect ones). - - - in reality the names are longer, not only a,b,.. and the table is tab-delimited, and the result table... (6 Replies)
Discussion started by: dietmar13
6 Replies
fluidballs(6x)							XScreenSaver manual						    fluidballs(6x)

NAME
fluidballs - the physics of bouncing balls. SYNOPSIS
fluidballs [-display host:display.screen] [-visual visual] [-window] [-root] [-count number] [-size number] [-gravity number] [-wind num- ber] [-elasticity number] [-delay number] [-nonrandom] [-no-shake] [-fps] DESCRIPTION
Models the physics of bouncing balls, or of particles in a gas or fluid, depending on the settings. If "Shake Box" is selected, then every now and then, the box will be rotated, changing which direction is down (in order to keep the settled balls in motion.) OPTIONS
-visual visual Specify which visual to use. Legal values are the name of a visual class, or the id number (decimal or hex) of a specific visual. -window Draw on a newly-created window. This is the default. -root Draw on the root window. -count number How many balls to display. Default: 300. -size number Maximum size of each ball. Default: 25. -gravity number Coefficient of gravity. Useful values are < 0.1. Default: 0.01. -wind number Wind. Useful values are < 0.1. Default: 0.00. -elasticity number Coefficient of elasticity. Useful values are 0.2 to 1.0. Default: 0.97. Lower numbers make less bouncy balls. -delay number Per-frame delay, in microseconds. Default: 10000 (0.01 seconds.). -nonrandom Make all balls be the same size. -no-nonrandom Make the balls be random sizes. Default. -shake | -no-shake Whether to shake the box if the system seems to have settled down. "Shake" means "change the direction of Down." -fps Display the current frame rate and CPU load. ENVIRONMENT
DISPLAY to get the default host and display number. XENVIRONMENT to get the name of a resource file that overrides the global resources stored in the RESOURCE_MANAGER property. SEE ALSO
X(1), xscreensaver(1) COPYRIGHT
Copyright (C) 2002 by Peter Birtles and Jamie Zawinski. Permission to use, copy, modify, distribute, and sell this software and its docu- mentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. No representations are made about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. AUTHOR
Peter Birtles, Jamie Zawinski, and Steven Barker. X Version 11 5.15 (28-Sep-2011) fluidballs(6x)
All times are GMT -4. The time now is 08:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy