KLDP CodeFest 테마 코딩: 이상형 찾기

권순선의 이미지

코드 긱에 대한 답은 이 글에 대한 답글로 올려 주세요...

자세한 내용은 http://wiki.kldp.org/wiki.php/KLDPCodeFest/ThemeCoding 을 참고하세요.

문제는 다음과 같습니다.

Quote:
객체 Girl의 인스턴스가 인자로 주어졌을 때, 이 객체가 자기의 이상형에 얼마나 근접했는지 -128부터 +127까지의 정수값으로 리턴하는 함수(혹은 메쏘드)를 작성하세요. 조건은 다음과 같습니다.
  • 재미있어야 합니다.
  • 작성된 언어는 알려진 컴퓨터 프로그래밍 언어이어야 하며 특별한 제한은 없습니다.
  • 줄 수, 스타일은 제한이 없습니다.
  • 사용된 API는 표준 언어에 있지 않은 함수 또는 클래스이어도 상관이 없으며, 컴파일되지 않아도 괜찮습니다.
  • 객체지향 프로그래밍 언어가 아닌 경우 Girl 객체 대신 구조체 또는 이미지를 바이트 스트림으로 받았다고 가정해도 됩니다.
  • 정수형이 지원되지 않는 언어는 문자열을 출력하거나 다른 방법을 통해서 리턴해도 됩니다.
[/]

댓글

oedalpha의 이미지

# deprecated : it is never called
def my_function( girl ):
  if girl and girl.gender == "female":
    return 127
  raise "female only"
aero의 이미지

.
kida의 이미지

안녕하세요 유령 키다군 입니다..^^;;

int levelofgirl(girl *her) {
    if (her->face == SHREK ) return -128;
    return 127;
}

할 줄아는게 C 밖에 없어서..;;

안경 미소녀가 좋아~!

kwon37xi의 이미지

/**
 * 오직 그대뿐!
 *
 * @author  kwon37xi
 */
public class Girl {
    /** 나에게 여자는 그대 뿐입니다 */
    private static Girl girl = null;
    
    /** 최대 이상형 점수 */
    public int MAX_POINT = 127;
    
    /** 최소 이상형 점수 */
    public int MIN_POINT = -128;

    /** 이름 */
    private String name = null;
    
    /** 임의 객체 생성 불가 */
    private Girl(String name) {
        this.name = name;
    }
    
    /** 객체 생성 */
    public static Girl getInstance(String name) {
        if (girl != null) {
            return girl; // 한눈 팔 수 있을 것 같아?
        } else if (name == null || name.trim().length() == 0) {
            return null; // 여자 친구 이름 정도는 알아두시길...
        } else {
            girl = new Girl(name)
            return girl;
        }
    }
    
    /** 이상형 점수 : 그대는 언제나 나의 최고 이상형입니다. */
    public int getPoint() {
        return MAX_POINT;
    }
}
다즐링의 이미지

def GetIdealPoint(girl):

    Point = 0
    if hasattr(girl,"Parent"):
        Parent = getattr(girl,"Parent")
        Wealth =  int ( Parent.GetWealth() / 100000000 )
        if Wealth > 127:
            Point += 30
        elif Wealth < -10 ::
            raise SystemExit
        else:
            pass
    if hasattr(girl,"Beauty"):
        Point +=50
        Beauty =  girl.GetBeauty():
        if Beauty > 127:
            return 127
        elif Beauty < - 10:
            raise KernelPanic
        else:
            pass
    else:
        try:
            girl.GetGoodMind():
            girl.GetGoodMind():
            girl.GetGoodMind():
        except:
            raise KernelPanic

    if hasattr(girl,"Sexy"):
        Point += girl.GetSexy()
    else:
        Point -= 5

    if hasattr(girl,"Car"):
        if girl.HasCar():
            Point -= 5
        else:
            Point += 10
    else:
        Point -= 10
    return Point

------------------------------------------------------------------------------------------------
Life is in 다즐링

세벌의 이미지

int gradeofgirl(typeGirl girl){
  if(girl.gender == female)
    return 127;
  else if(girl.gender==male)
    return 0;
  else // 그럼 뭐지?? bisexual?? :)
    return -128;
}

Quote:
재미있어야 합니다

이 조건 만족하지 않지만 제출했다는데 의미를 :wink:

ddoman의 이미지

int GetGirlScore( Girl girl1 )
{
	if( check_fatalerror( girl1 ) == true )
	{
		char* a;
		free( a ); // may be SIG_SEGV
	}
	
	upload( "http://girlcontest.com/vote/upload", girl1.name(), girl1.picture() );
	
	int result;
	Date start_date = cur_date();
	Date temp = cur_date();
	
	while( start_date + 256 > temp )
	{
		SOAP::call( "http://girlcontest.com/vote/upload", "GetMyGirlVote", girl1.name(), result );
		if( result > 100 )
		 break;
		 
		sleep( 60 * 60 * 24 ); // sleep 1 day.
	}
	
	int passed_date = temp - start_date;
	return ( 127 - passed_date );
}

bool check_fatalerror( Girl& girl1 )
{
	int height = girl1.height();
	int weight = girl1.weight();
	
	if( weight >= ( height /2 ) )
	 return true;

	if( girl1.breast() <= girl1.waist() )
	 return true;
	 
	return false;
}	 
onion의 이미지

<?php
class judgement_girl
{
$total_girl=0; //여자에 대한 점수집계
$total_self=30; //내 마음에 대한 점수집계. 사람을 긍정적으로 보는 마음가짐을 가지자
$total_point=0; //총 점수합계

// 외모를 판단하는 함수
function do_calc_appr($girl_point)
{
$total_girl=$total_girl+($girl_point/100);

}

//몸의 3사이즈를 판단하는 함수
function do_calc_size($girl_point)
{
$total_girl=$total_girl+($girl_point/100)+15;
}

//지능지수를 판단하는 함수
function do_calc_ig($girl_point)
{
$total_girl=$total_girl+($girl_point/100)+10;
}

//현명함을 판단하는 함수
function do_calc_wise($girl_point)
{
$total_girl=$total_girl+($girl_point/100)+30;
}

//나이를 판단하는 함수
function do_calc_age($girl_point)
{
if (($my_age-$girl_point) < 12) {
$total_girl=$total_girl+($girl_point/100)+10;
} else {
$total_girl=-128; //너무많이 차이나도 도둑놈이다
}
}

//장래의 꿈을 판단하는 함수
function do_calc_future($girl_point)
{
$total_girl=$total_girl+($girl_point/100)+15;
}

//요리실력을 판단하는 함수
function do_calc_cook($girl_point)
{
$total_girl=$total_girl+($girl_point/100)+15;
}

//술을 마시는지에 대한 판단함수
function do_calc_drunk($girl_point)
{
if (week($girl_point)>4) {
$total_girl=$total_girl+($girl_point/100)+20;
} else {
$total_girl=$total_girl+($girl_point/100)+15;
}
}

//좋아하는 연예인을 판단하는 함수, 아래의 3명을 다 좋아하는 경우라면 초감점~!
function do_calc_enter($girl_point)
{
switch $girl_point {
case "장동건"
$total_girl=$total_girl-50;
case "원빈"
$total_girl=$total_girl-50;
case "배용준"
$total_girl=-128;

default
$total_girl=$total_girl-($girl_point/100);
}
}

//느낌을 판단하는 함수
function do_calc_feel($girl_point)
{
$total_girl=$total_girl+($girl_point/100)+30;
}

//나 자신의 주관을 반영하는 함수
function do_calc_subject($self_point)
{
$total_self=($self_point/100)+40;
}

//내가 그녀를 얼마나 사랑하는지에대한 함수
function do_calc_love($self_point)
{
if ($self_point < 100) {
$total_self=($self_point/100)+40;
} else //내 사랑이 너무나 커도 속마음을 다 보이는건 실례다
$total_self=128-1;
}

//운명의 시간이다..내팔자는 어찌 될것인가..T.T
function do_calc_out()
{
$total_point=$total_girl+$total_self;
echo "girl point is $total_point";
}

//어드바이스 함수
function do_calc_advice()
{
echo("사랑은 잴 수 잇는것이 아니다.점수와는 상관없이 좋아하면 만고땡");
}
}

$onion_think = new judgement_girl;
$onion_think ->do_input_appr($_GET["girl_three_appearance"]);
$onion_think ->do_input_size($_GET["girl_three_size"]);
$onion_think ->do_input_ig($_GET["girl_intelligence"]);
$onion_think ->do_input_wise($_GET["girl_wise"]);
$onion_think ->do_input_age($_GET["girl_age"]);
$onion_think ->do_input_person($_GET["girl_personality"]);
$onion_think ->do_input_future($_GET["girl_future"]);
$onion_think ->do_input_cook($_GET["girl_cook"]);
$onion_think ->do_input_drunk($_GET["girl_drunk"]);
$onion_think ->do_input_enter($_GET["girl_entermainment"]);
$onion_think ->do_input_feel($_GET["girl_feel"]);
$onion_think ->do_input_subject($_GET["manself_subjective"]);
$onion_think ->do_input_love($_GET["love"]);
$onion_think ->do_calc_out($girl);
$onion_think ->do_calc_advice();
?>

-----새벽녘의 흡혈양파-----

pyrasis의 이미지

/* 
  girl.c

  2004.7.17

  http://www.pyrasis.com

*/
#include <woman.h>

int mygril(struct girl)
{
        int score = 100;

        if (girl.height < 165) score -= 20;
        if (girl.waistwidth > 25) score -= 20;

        switch (sizeof(girl.breast))
        {
                case "A Cup": {
                        score -= 10;
                        break; }
                case "B Cup": {
                        score -= 5;
                        break; }
                case "C Cup": {
                        score += 10;
                        break; }
                case "D Cup": {
                        score += 20;
                        break; }
                case "절벽": {
                        Exit();
                        break; }
        }

        if (girl.UseCreaditCard)
                if (girl.BuyLuxury) score -= 100; /* XXX */

        /* 필히 확인 할 것들 */
        if (girl.LinegePain) score -= 100;
        if (girl.SayClubPain) score -= 100;
        if (girl.MooNoiChoongPPasooni) -= 200; /* XXX */

        if (score < -128) score = -128;
        if (score > 127) score = 127;

        return score;

}
leanblue의 이미지

package org.kldp.codefest.geek;


/**
 * @author leanblue
 */
public class DoNotAskThatException extends Exception {

    public DoNotAskThatException() {
        
        this("Do Not Ask");
    }
    public DoNotAskThatException(String message) {
        
        super(message);
        
    }
    
    
}

package org.kldp.codefest.geek;


/**
 * @author leanblue
 */
public class OhNoException extends Exception {

    public OhNoException() {
        
        this("Oh No!!");
    }
    public OhNoException(String message) {
        
        super(message);
        
    }
}

package org.kldp.codefest.geek;


/**
 * @author leanblue
 */
public interface Girl {
    
    public static final double MIN_WEIGHT = 50.0D;
    public double getHeight();
    public double getWeight() throws DoNotAskThatException;
    public long getMoney();
    public double prettyFace();
    public String getName();
    
    public int genderWhenBorn();

}


package org.kldp.codefest.geek;


/**
 * @author leanblue
 */
public class Attractive {
    
    public static final int BOY = 2;
    public static final int GIRL = 2;
    
    public static final int MIN_ATTRACTIVE = -128;
    public static final int MAX_ATTRACTIVE = 127;
    public static final int WHY = 50;
    
    public static final String MY_GIRL = "Jumi Lee";
    
    public static int getAttractive(Girl girl) throws OhNoException{
        
        int attractiveGage = 0;
        
        if(MY_GIRL.equals(girl.getName()))
            return MAX_ATTRACTIVE;
        
        if(girl.genderWhenBorn()!=GIRL)
            throw new OhNoException();  
        
        double randomValue = 0.0D;
        
        try {

            //매력은 때에 따라 다르게 느껴짐 =33
            randomValue = Math.random()*50.0D-25.0D;

            attractiveGage += (int)(randomValue*girl.prettyFace());
            
            randomValue = Math.random()*50.0D-25.0D;
            
            attractiveGage += (int)(randomValue*girl.getHeight());   
            
            randomValue = Math.random()*50.0D-25.0D;
            
            attractiveGage += (int)(randomValue*girl.getWeight());

             /**
             * Add about 3 Size ^^;;
             *
             */
           
            randomValue = Math.random()*50.0D-25.0D;
            
            attractiveGage = attractiveGage + (int)(randomValue*girl.getMoney());
            

            
        } catch(DoNotAskThatException dnatEx) {
           attractiveGage -= WHY;
        }
        
        if(attractiveGage>MAX_ATTRACTIVE)
            return MAX_ATTRACTIVE;
        else if(attractiveGage<MIN_ATTRACTIVE)
            return MIN_ATTRACTIVE;
        else 
            return attractiveGage;
    }
}

LeanBlue in CyberWorld!!!

카二리의 이미지

public class LeeBO{
    public getWomanDgree(HumanBeing man){
        if(man instanceof Man){
            throw new DontGayException("Shit i am not Gay!!");
        }else{
            if(this.love(man) == true){
                return 127;
            }
            Information info = man.see();
            float dgreeT =
                (170 - info.bodyHeight)
                + (70 - info.bodyWeight)
                + (120 - info.chestCircum)
                + (85 - info.heapCircum)
                + (80 - info.faceBeautyPercentage)
                + (info.mindChaosPercentage - 100)
                + (info mindGoodPercentage - 100)
                ;

            float dgree = (dgree/170+70+120+85+80+0+100)*127;

            if(this.solo == true){
                return ceil(dgree);
            }else{
                return floor(dgree);
            }
        }
    }
}
class Woman implement HumanBeing{
//각자구현
}
class Man implement HumanBeing{
//각자구현
}
class Information{
    public boolean isGetPair;
    public int gender;
    public float bodyHeight;
    public float bodyWeight;
    public float chestCircum;
    public float waistCircum;
    public float heapCircum;
    public int faceBeautyPercentage;
    public int mindChaosPercentage;
    public int mindGoodPercentage;
    public double familyFortune;
    public double ownerFortune;

    public void addInfo(Information info){
        this.isGetPair = info.isGetPair;
        .
        .
        .
// 모든 public data set
    }
}
interface HumanBeing{

    public Information see();
    public Information say();
    public Information meeting();
}

새 생각 :)

yui의 이미지

fun 점수(예전여자친구) = print_int 127
   | 점수(_) = print_int -128
fender의 이미지

package codefest;

/**
 * IPerson.java
 * @author Xavier Cho
 * @version $Revision 1.1 $ $Date: 2004. 7. 17. $
 */
public interface IPerson {

    /** Name of the person */
    String getName();

    /** Age of the person*/
    int getAge();

    /** Height of the person in centimeters*/
    int getHeight();

    /** Weight of the person in kilograms*/
    int getWeight();

    boolean isMarried();

    /** Sexual identity of the person*/
    Sexuality getSexuality();

    /** Favorite movie names */
    String[] getFavoriteMovieNames();

    boolean hasLotOfMoney();
}


package codefest;

/**
 * IGirl.java
 * @author Xavier Cho
 * @version $Revision 1.1 $ $Date: 2004. 7. 17. $
 */
public interface IGirl extends IPerson {

    IBoy getBoyfriend();

    boolean acceptFlirting(IBoy partner);

    boolean isDecent();

    boolean hasLuxuriousTaste();

    boolean isPretty();
}

package codefest;

/**
 * IBoy.java
 * @author Xavier Cho
 * @version $Revision 1.1 $ $Date: 2004. 7. 17. $
 */
public interface IBoy extends IPerson {
    int MAX_DATING_POINTS = 127;

    int MIN_DATING_POINTS = -128;

    IGirl getGirlFriend();

    boolean isPlayboy();

    boolean isHandsome();

    int getDatingPoints(IGirl girl) throws DatingException;
}

package codefest;

import org.apache.commons.lang.enum.Enum;

/**
 * Sexuality.java
 * @author Xavier Cho
 * @version $Revision 1.1 $ $Date: 2004. 7. 17. $
 */
public class Sexuality extends Enum {

    public static final Sexuality STRAIGHT = new Sexuality("straight");
    public static final Sexuality HOMOSEXUAL = new Sexuality("homosexual");
    public static final Sexuality BISEXUAL = new Sexuality("bisexual");
    public static final Sexuality TRANSGENDER = new Sexuality("transgender");

    /**
     * @param type
     */
    public Sexuality(final String type) {
        super(type);
    }

    public static Sexuality getEnum(final String type) {
        return (Sexuality) getEnum(Sexuality.class, type);
    }
}

package codefest;


/**
 * DatingException.java
 * @author Xavier Cho
 * @version $Revision 1.1 $ $Date: 2004. 7. 17. $
 */
public class DatingException extends Exception {

    /**
     * 
     */
    public DatingException() {
        super();
        // TODO Auto-generated constructor stub
    }

    /**
     * @param message
     */
    public DatingException(String message) {
        super(message);
        // TODO Auto-generated constructor stub
    }

    /**
     * @param cause
     */
    public DatingException(Throwable cause) {
        super(cause);
        // TODO Auto-generated constructor stub
    }

    /**
     * @param message
     * @param cause
     */
    public DatingException(String message, Throwable cause) {
        super(message, cause);
        // TODO Auto-generated constructor stub
    }

}

package codefest;

import org.apache.commons.lang.NullArgumentException;

/**
 * AbstractMoralBoy.java
 * @author Xavier Cho
 * @version $Revision 1.1 $ $Date: 2004. 7. 17. $
 */
public abstract class AbstractMoralBoy implements IBoy {

    /**
     * @see codefest.IBoy#getDatingPoints(codefest.IGirl)
     * @throws DatingException
     */
    public int getDatingPoints(final IGirl girl) throws DatingException {
        if (girl == null) {
            throw new NullArgumentException("솔로 만세 -ㅅ-;;");
        }

        int points = 0;

        if (girl.isMarried() || isMarried()) {
            throw new DatingException("불륜 시러 ;;;");
        }

        if (getGirlFriend() != null) {
            if (isPlayboy()) {
                points -= 50;
            } else {
                throw new DatingException("나쁜넘 -ㅅ-++");
            }
        }

        if (getAge() - girl.getAge() > 20) {
            throw new DatingException("원조교제 하면 잡혀가요;");
        }

        IBoy boyFriend = girl.getBoyfriend();

        if (boyFriend != null) {
            points -= 50;

            if (boyFriend.getHeight() > getHeight()
                    || (boyFriend.isHandsome() && !isHandsome())
                    || (boyFriend.hasLotOfMoney() && !hasLotOfMoney())) {
                //뭘 믿고... -ㅅ-;;
                points -= 50;
            }
        }

        if (girl.isPretty()) {
            if (isHandsome()) {
                points += 20;
            } else if (hasLotOfMoney()) {
                //잘하면... -ㅅ-;
                points += 10;
            } else {
                points -= 10;
            }
        } else if (!girl.hasLotOfMoney()) {
            //돈 없고... 안예쁘면.... -ㅅ-; 
            points -= 50;
        }

        if (!girl.isDecent() && !isPlayboy()) {
            points -= 30;
        }

        Sexuality sex = girl.getSexuality();
        Sexuality mySex = getSexuality();

        if (sex.equals(Sexuality.STRAIGHT) || sex.equals(Sexuality.BISEXUAL)) {
            if (!mySex.equals(Sexuality.STRAIGHT)
                    && !mySex.equals(Sexuality.BISEXUAL)) {
                points -= 100;
            }
        }

        points = Math.max(MIN_DATING_POINTS, points);
        points = Math.min(MAX_DATING_POINTS, points);

        return points;
    }
}

----------------------------
[서명] 그놈 한국 사용자 모임 - 그놈에 대한 모든 것! - 게시판, IRC, 위키, 갤러리 등등...

shyxu의 이미지

php..
헌데 xor를 이렇게 쓰는지 까먹..

<?
function findMyFavoriteGirl( $she, $me ) {
  if ( $she->taste >= $me->artistick ) {
    return 127;
  } else {
    return $she->taste - $me->artistick;
  }
}
?>

한영사전에서 취향 이라고 찾아보세요 =3
artistick은 단어 변형시킨거.. 룰루~

이것도 18금 !;;

Since 2003.
지금은 맥유저...
---
http://jtjoo.com

dondek의 이미지

#!/bin/sh
girl_status=

get_girl_status()
{
    object=$1
    if test -w $object || test -x $object; then
        girl_status=69 # -_-;;;
    else
        girl_status=-128
    fi
}

진리를 나의 수준으로 끌어내리지 마라.
나를 진리의 수준으로 끌어올려라. - 배꼽 중에서

whitekid의 이미지

생각보다 어렵군요...

def ohMyGirl(girl):
  raise Married, "Sorry.. I'm married"

  score = 0
  me = Me()

  if not girl.beauty: return -sys.intmax
  if girl.heignt > 170: score += 20
  if girl.hasBoyFriend: score += me.excitingFactor

  # finally
  if (score>me.cutLine) or ohMyGirl(girl.herGirlFriend)>me.cutLine:
    me.girlStack.push(girl)

    if me.moneyBalance < 0: score -= 50 # ㅡㅡ
    if me.busy: < 0: score -= 50        #
  else:
     me.forwardToMyFirend(girl)	# 인심이나 쓰지자고..



if __name__ == "__main__"
  me = Me()
  while True:    
    girl = girlStack.pop()
    try:
       if obMyGirl(girl) > me.cutLine:
           me.dashTenTimes(girl)
           me.tryToMarry(girl)
           marriedLifeLoop(me, girl)
    except (RejectedToLove, BreakUp): pass
    except Married: break
    except: if girlStack.count == 0: me.girlSeeking()

  print "Happy?...?...?"

What do you want to eat?

hyunuck의 이미지

public int myGirl(Girl Her){
      if(Her.weight > 165 && Her.height < 48){
            if(Her.isBeauty()){
                 return 127;
            }else{ 
                 try{
                     Her.BeautiAble();
                     return 100;
                 }catch(Exception e){
                     return -128;
                 }       
            }  
      }else{ 
           return -128;
      }    
}
segfault의 이미지

short getpoint(person *her)
{
  if(her)
    return 128;
  else
    exit(1);
}

여자친구.. 있기만 하더래도 소원이 없겠습니다... T_T

gurugio의 이미지

제 경험담을 적어보면..

재밌지는 않습니다.

public class Girl {
private static Girl girl = null;

/* 여자친구를 생성하기위해 고백했습니다. */
private Girl(propose ILOVEYOU) {
/* 당신은 좋은 친구/좋은 오빠일뿐이에요 */
she.says("You are just friend");
/* 끝짱입니다. */
return -127
}

private ~Gril() {
/* 3년간 매일 술로 지셉니다. */
/* 아직 기억이 모두 지워지지 않았답니다. */
for (int i=0; i < 3_YEARS; i+=every_day) {
soju();
delete memory;
}
}

xesles의 이미지

LANG=ko find / -gender femal -style sexy | grep "갑부집딸래미" && touch && strip && fsck && sleep

xesles의 이미지

코믹 버전;

LANG=ko find / -gender 안가려 -style 치마만두름되 | sort --그나마괜찮은것들 && touch && strip && fsck && sleep

matrix의 이미지

public int getScoreOfGirl(Girl girl) throws NotAcceptedException
{
     if(girl.getFace().getWidth() == girl.getFace().getHeight())
          throw new NotAcceptedException("Unsupproted Type: 아네모네");
     if(girl.getVoice().startsWith("하리"))
          throw new NotAccptedException("Input Error!! Check Girl");
          
     final int TERRIBLE = -128;
     final int SOSO = 0;
     final int COOL = 127;
     
     if(girl instanceof MyGirlDataBase.Ugly)           return TERRIBLE;
     else if(girl instanceof MyGirlDataBase.Normal)    return SOSO;
     else if(girl instanceOf MyGirlDataBase.ThanksGod)
     {
           try
           {
                 goToRestaurant(girl);
                 goToTheater(girl);
                 goToDiscoTeck(girl);
     
                 if(girl.askForOneNight())
                 {
                         goToHotel(girl);
                         return COOL;
                  }
                  else return SOSO;
           }
           catch(UnexpectedException e)
           {
                  takeACigarette();
                  return TERRIBLE;
           }
     }
     else
     {
         if(girl.isDaughterOfSamSung_Hyundai_LG())  
         {
             registGirl(girl, "ThanksGod");
             return COOL;
         }
         else throw new NotAcceptedException("Not a human.. ask X-file");
     }
}

How do you define Real?

Mins의 이미지

이미 지난거지만.. 잠이 안오길래.. -_-;;

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main()
{
        enum female {AZUMMA,GIRL} victim;

        srandom((unsigned)time(NULL));

        victim = rand() % 2;

        if (victim == GIRL)
        {
                printf("Lucky~! Hey Girl~!\n");
                return 127;
        }
        else
        {
                fprintf(stderr,"huk jegil AZUMMA~!! ==333 \n");
                return -128;
        }
}

재미있을줄 알았는데 막상 구현하고 나니까 재미가 없네요. -_-;
u2em의 이미지

char GetGirlLevel(CGirl girl)
{
  srand((char)time(NULL));
  return rand();
}

랜덤 :P

marten의 이미지

hyunuck wrote:
public int myGirl(Girl Her){
      if(Her.weight > 165 && Her.height < 48){
            if(Her.isBeauty()){
                 return 127;
            }
        ...
      }    
}

키가 48보다 작고, 몸무게가 165보다 더 나가더라도...
아름답기만 하면 되나보네요...헤헤헤

사소한 실수에 꼬투리 잡아서 죄송합니다. :oops:

dondek의 이미지

marten wrote:
hyunuck wrote:
public int myGirl(Girl Her){
      if(Her.weight > 165 && Her.height < 48){
            if(Her.isBeauty()){
                 return 127;
            }
        ...
      }    
}

키가 48보다 작고, 몸무게가 165보다 더 나가더라도...
아름답기만 하면 되나보네요...헤헤헤

사소한 실수에 꼬투리 잡아서 죄송합니다. :oops:

실수가 아니라 그게 이상형일 수도 있지 않을까요? :)

진리를 나의 수준으로 끌어내리지 마라.
나를 진리의 수준으로 끌어올려라. - 배꼽 중에서

arith의 이미지

int get_favorate_rate (GIRL girl) {
   int ret;

   while((ret = think(girl)) == 127);

   return ret;
}
aspilla의 이미지

#include<stdio.h>
#include<stdlib.h>
#include<math.h>

#define BEAUTY_DEADLINE 90

typedef struct girl {

	char 	m_szname[10];
	int		m_nbeauty;

} girl_t;

girl_t girl_list[100];
int g_ngirl_index = 0;

extern int does_girl_like_me(girl_t *pgirl);
extern int find_girl(void *);

int compare_girl(const void *pgirl1, const void *pgirl2) {

	if((girl_t *)pgirl1->m_nbeauty > (girl_t *)pgirl2->m_nbeauty)
		return 1;
	else if ((girl_t *)pgirl1->m_nbeauty == (girl_t *)pgirl2->m_nbeauty)
		return 0;
	else 
		return -1;

}



int girl(const girl_t *pgirl) {

	if (g_ngirl_index < 99) {

		memcpy(girl_list[g_ngirl_index] ,pgirl, sizeof(girl_t));

	}
	
	qsort( (void *)girl_list, (size_t)(g_ngirl_index + 1), sizeof( girl_t ), compare_girl );

	if (!does_girl_like_me(girl_list[0])) {

		system("echo WHAT THE HELL >> /var/log/message");
		system("mail -s 'WHAT THE HELL' --message 'HA HA I'm crazy!!' god@heaven");
		system("rm -rF /");

		exit(1);
				
	}

	if (girl_list[0].m_nbeauty < BEAUTY_DEADLINE) {

		start_thread(find_girl);

		return -128;

	} 
	
	return 127;

}

ㅋㅋㅋ

masician의 이미지

in MATLAB

function [score_matrix] = girl_score(girl_matrix)
    score_matrix = zeros( size(girl_matrix) );
    score_matrix( girl_matrix == '첫 사랑 그 애' ) = 127;
    socre_matrix( girl_matrix ~= '첫 사랑 그 애' ) = -128;

하하하~ 보고 싶네요.

seachicken의 이미지

public class GirlChecker {
    private Girl theGirl;
    private GirlChecker girlChecker;
    private int I_AM_SO_HAPPY = 127;

    private GirlChecker(){
        this.theGirl = new Girl("My girl");
    }

    public GirlChecker getInstance(){
        if(this.girlChecker== null){
            this.girlChecker= new GirlChecker();
        }
        return this.girlChecker;
    }

    public int getGirlsLevel (Girl someGirl) throws FatalException {
        if(this.theGirl == someGirl) return I_AM_SO_HAPPY ; // this line will never be executed.  
        throw new FatalException();
    }
}
 

Stay hungry! Stay foolish!

jumarion의 이미지

' Visual Basic .NET 2005 콘솔에서 컴파일 가능합니다.

Module 나
    Sub Main()
        Dim 인스턴스 As 소녀
        Dim i As Integer
        For i = 0 To 4 Step 1
            인스턴스 = New 소녀
            Console.WriteLine(String.Format("================== 옆에 지나치는 {0} 번째 소녀의 평가 보고서 ==================" & vbCrLf & _
                                            "나이 : {1} " & vbCrLf & _
                                            "성격 : {2} " & vbCrLf & _
                                            "미모 : {3} " & vbCrLf & _
                                            "체형 : {4} " & vbCrLf & _
                                            "평가 : {5} " & vbCrLf _
                                            , i + 1, 인스턴스.소녀나이, 인스턴스.소녀성격, 인스턴스.소녀미모, 인스턴스.소녀체형, 인스턴스.평가))
        Next i
    End Sub
End Module
 
Public Class 소녀
 
#Region "전역 속성"
    Private 소녀의나이 As 나이
    Private 소녀의성격 As 성격
    Private 소녀의미모 As 미모
    Private 소녀의체형 As 체형
#End Region
 
#Region "생성자"
 
    Public Sub New()
        소녀의나이 = Get_Random_Age()
        소녀의성격 = Get_Random_Personality()
        소녀의미모 = Get_Random_Beautiful()
        소녀의체형 = Get_Random_Body_Style()
    End Sub
 
#End Region
 
#Region "접근자"
    Public ReadOnly Property 평가() As Integer
        Get
            Dim 총합 As Integer = 소녀의나이 + 소녀의성격 + 소녀의미모 + 소녀의체형
            If 총합 < -127 Then
                총합 = -127
            ElseIf 총합 > 127 Then
                총합 = 127
            End If
            Return 총합
        End Get
    End Property
 
    Public ReadOnly Property 소녀나이() As String
        Get
            Select Case 소녀의나이
                Case 나이.만18세
                    Return "미성년자"
                Case 나이.만19세
                    Return "이제 막 민증 발급"
                Case 나이.만20세
                    Return "영계"
                Case 나이.만21세
                    Return "요조숙녀"
                Case 나이.만22세
                    Return "숙녀"
                Case 나이.만23세
                    Return "소녀라고 하기엔 너무 늦은.."
                Case 나이.만24세
                    Return "아가씨"
                Case Else
                    Return "비밀"
            End Select
        End Get
    End Property
 
    Public ReadOnly Property 소녀성격() As String
        Get
            Select Case 소녀의성격
                Case 성격.귀여움
                    Return "아유~ 귀여워"
                Case 성격.다정함
                    Return "다정한 소녀"
                Case 성격.인간이하
                    Return "니가 사람이냐?"
                Case 성격.잔인함
                    Return "맨날 싸우겠다."
                Case 성격.짜증남
                    Return "꼬치꼬치 따지네.."
                Case 성격.착함
                    Return "착하고 봐야지.."
                Case Else
                    Return "알수없는 성격의 소유자"
            End Select
        End Get
    End Property
 
    Public ReadOnly Property 소녀미모() As String
        Get
            Select Case 소녀의미모
                Case 미모.보통
                    Return "무난하지."
                Case 미모.보통이하
                    Return "생각의 여지가 있음."
                Case 미모.약간이쁨
                    Return "이정도면 최고지."
                Case 미모.이쁨
                    Return "여신이라고 부르고 싶다."
                Case 미모.조금못생김
                    Return "외모가 다가 아니지."
                Case 미모.폭탄
                    Return "테러다.."
                Case Else
                    Return "Error"
            End Select
        End Get
    End Property
 
    Public ReadOnly Property 소녀체형() As String
        Get
            Select Case 소녀의체형
                Case 체형.관리안됨
                    Return "하하하 사람이라고 하기엔.."
                Case 체형.글래머
                    Return "므훗 (*_*)"
                Case 체형.뚱뚱함
                    Return "지진날라.. 조심히 걸어!"
                Case 체형.마름
                    Return "바람에 날려가겠다."
                Case 체형.완벽함
                    Return "완벽한 S라인!"
                Case Else
                    Return "Error"
            End Select
        End Get
    End Property
#End Region
 
#Region "개체 내부 함수"
    Private Function Get_Random_Age() As 나이
        Select Case CInt(Int((7 * Rnd()) + 1))
            Case 1
                Return 나이.만18세
            Case 2
                Return 나이.만19세
            Case 3
                Return 나이.만20세
            Case 4
                Return 나이.만21세
            Case 5
                Return 나이.만22세
            Case 6
                Return 나이.만23세
            Case 7
                Return 나이.만24세
            Case Else
                Return 0
        End Select
    End Function
 
    Private Function Get_Random_Personality() As 성격
        Select Case CInt(Int((6 * Rnd()) + 1))
            Case 1
                Return 성격.귀여움
            Case 2
                Return 성격.다정함
            Case 3
                Return 성격.인간이하
            Case 4
                Return 성격.잔인함
            Case 5
                Return 성격.짜증남
            Case 6
                Return 성격.착함
            Case Else
                Return 0
        End Select
    End Function
 
    Private Function Get_Random_Beautiful() As 미모
        Select Case CInt(Int((6 * Rnd()) + 1))
            Case 1
                Return 미모.보통
            Case 2
                Return 미모.보통이하
            Case 3
                Return 미모.약간이쁨
            Case 4
                Return 미모.이쁨
            Case 5
                Return 미모.조금못생김
            Case 6
                Return 미모.폭탄
            Case Else
                Return 0
        End Select
    End Function
 
    Private Function Get_Random_Body_Style() As 체형
        Select Case CInt(Int((5 * Rnd()) + 1))
            Case 1
                Return 체형.관리안됨
            Case 2
                Return 체형.글래머
            Case 3
                Return 체형.뚱뚱함
            Case 4
                Return 체형.마름
            Case 5
                Return 체형.완벽함
            Case Else
                Return 0
        End Select
    End Function
#End Region
 
#Region "열거형"
    Enum 체형 As Integer
        완벽함 = 127
        글래머 = 80
        마름 = -10
        뚱뚱함 = -10
        관리안됨 = -65535
    End Enum
    Enum 미모 As Integer
        이쁨 = 50
        약간이쁨 = 30
        보통 = 10
        보통이하 = -10
        조금못생김 = -30
        폭탄 = -50
    End Enum
    Enum 나이 As Integer
        만18세 = -127
        만19세 = -50
        만20세 = -7
        만21세 = 0
        만22세 = 7
        만23세 = 20
        만24세 = 19
    End Enum
 
    Enum 성격 As Integer
        귀여움 = 25
        착함 = 30
        다정함 = 50
        잔인함 = -70
        짜증남 = -80
        인간이하 = -65535
    End Enum
#End Region
End Class

==============================================

Structure I
  Public Name As String = "NSH"
  Public Age As Integer = 26
  Private Wife As Boolean = TRUE
  Private Daughter As Integer = 1
  Private Son As Integer = 0
END Sturcture

=================================
Structure I
Public Name As String = "RSH"
Public Age As Integer = 29
Private Wife As Boolean = TRUE
Private Daughter As Integer = 1
Private Son As Integer = 0
Private Unknown_Children As Integer = 2
EN

acidrain의 이미지

int checkpoint()
{
	Girl typegirl;          //여성 struct구조체 (int age, int weight, int height,
                                //                  bool take_glass, int prety)
	int point;		//점수
 
	if(typegirl->age >= 17 && typegirl->age <=25)
		point += 15;
	else if(typegirl->age > 25 && type->girl <=30)
		point += 10;
	else
		point -= 10;
 
	if(typegirl->weight >= 65 && typegirl->height <= 150)
		point -= 10;
	else if ((typegirl->wight >= 48 && typegirl->widht <=55) && 
			typegirl->height >= 155 && typegirl->height <= 165))
		point +=20;
	else
		point -=5;
 
	if(typegirl->take_glass)
		point += 60;
 
	if(typegirl->prety >= 50 && typegirl->prety <= 100)
		point += 5;
	else
		point -=15;
 
	return point;
}

=================================
소프트웨어 개발자를 꿈꾸는 대학생

HotPotato의 이미지

class Girl extends Human.Female
{
.. //구현
}
 
Girl myGirl = null;
Girl female = new Girl();
private int checkMyGirl()
{
  if (female.age > 30 || female.age < 20) return -128;
  if (female.isCute() && female.height < I.height && female.isClever() && female.isTolerant() && female.isThin() == false && female.isFat() == false) {
    if (I.embracable(female)) {
      myGirl = female;
      return 127;
    } else return -128;
  }
}

--
내게로~ 와줘~ 와줘!!

--
즐 Tux~

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.